Restmancer API - Weather

This page documents the available REST endpoints for fetching mock weather data such as temperature, humidity, and condition.

GET /api/weather

Returns fake weather data for cities. You can filter by city, limit the number of records, or select only specific fields.

Optional Query Parameters:

  • city – City name (e.g., London).
  • limit – Number of weather records to return.
  • fields – Comma-separated list of fields (e.g., city,temp,condition).

Examples:

Fields Available

  • id
  • city
  • temperature
  • condition
  • humidity
  • windSpeed
  • updatedAt

You can customize the weather response by controlling fields and limit.

Example: GET /api/weather?fields=city,temp,condition&limit=3

import requests

url = "https://restmancer.vercel.app/api/weather"
response = requests.get(url)
print(response.json())
fetch("https://restmancer.vercel.app/api/weather")
  .then(res => res.json())
  .then(data => console.log(data));
const axios = require("axios");

axios.get("https://restmancer.vercel.app/api/weather")
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
  });
curl "https://restmancer.vercel.app/api/weather"