🌍

weather

Current weather conditions and meteorological data for a specific location including temperature, humidity, pressure, wind, visibility, UV index, and weather conditions. Used for weather applications, forecasting services, and climate monitoring.

🎯 Request Builder

https://api.mockly.codes/weathers?page=1&limit=10&count=10
📡

Configure your request and click Send Request to see the response here.

Endpoints

GET/weathers

Get a collection of weather

Alternative: /location/weathers
GET/weathers/:id

Get a single weather by ID

Alternative: /location/weathers/:id
GET/weathers/meta

Get resource metadata and schema

Alternative: /location/weathers/meta
🔍

How to Use Search

The search feature allows you to filter results by searching for text across all or specific fields. Choose between ?q= or ?search= parameter names.

1. Basic Search

Search across all text fields:

Basic Search
GET https://api.mockly.codes/weathers?q=laptop

2. Search Specific Fields

Field-Specific Search
GET https://api.mockly.codes/weathers?q=laptop&search_fields=name,description

💡 Pro Tips

  • Search is case-insensitive and performs partial matching
  • Without search_fields, all text fields are searched
  • Combine with pagination to handle large result sets efficiently

Code Examples

JavaScript

Fetch Collection
// Get 10 weather
fetch('https://api.mockly.codes/weathers?count=10')
  .then(res => res.json())
  .then(data => console.log(data));

Python

Fetch with Requests
import requests

response = requests.get(
    'https://api.mockly.codes/weathers?count=10'
)
data = response.json()

cURL

Command Line
curl "https://api.mockly.codes/weathers?count=10"

Bypass Cache

Get Fresh Data
fetch('https://api.mockly.codes/weathers?nocache=true')

Schema Properties

idintegerrequired

Unique identifier for the weather record

Gen:random_int
citystringrequired

Name of the city where weather was observed

Gen:city
countrystringrequired

Name of the country where weather was observed

Gen:country
latitudenumber

Geographic latitude coordinate of the weather observation location

Gen:latitude
longitudenumber

Geographic longitude coordinate of the weather observation location

Gen:longitude
temperaturenumberrequired

Current air temperature in degrees Celsius

Gen:temperature
feels_likenumber

Apparent or 'feels like' temperature in degrees Celsius, accounting for wind and humidity

Gen:temperature
humidityinteger

Relative humidity percentage (0-100)

Gen:humidity
pressureinteger

Atmospheric pressure in hectopascals (hPa) or millibars

Gen:pressure
wind_speednumber

Wind speed in meters per second

Gen:wind_speed
wind_directionstring

Wind direction (e.g., N, NE, E, SE, S, SW, W, NW) or degrees (0-360)

Gen:wind_direction
conditionstring

Current weather condition (e.g., clear, cloudy, rain, snow, fog, storm)

Gen:weather_condition
descriptionstring

Detailed textual description of current weather conditions

Gen:weather_description
visibilityinteger

Horizontal visibility distance in meters

Gen:visibility
uv_indexinteger

Ultraviolet (UV) index value (0-11+), indicating sunburn risk

Gen:uv_index
timestampstring

Timestamp when the weather observation was recorded

Gen:date_timedate-time

Query Parameters

countinteger

Number of items to return (default: 10, max: 100)

seedinteger

Seed for reproducible data generation

nocacheboolean

Bypass cache and generate fresh data on every request