Skip to main content
GET
/
api
/
weather
Get weather data for a city
curl --request GET \
  --url https://first-api-endpoint.vercel.app/api/weather \
  --header 'Authorization: Bearer <token>'
{
  "city": "San Francisco",
  "country": "USA",
  "temperature": {
    "current": 65,
    "feelsLike": 63,
    "unit": "fahrenheit"
  },
  "condition": "Partly Cloudy",
  "humidity": 72,
  "windSpeed": 8,
  "pressure": 1013,
  "visibility": 10,
  "uvIndex": 3,
  "timestamp": "2024-11-29T10:30:00Z",
  "forecast": [
    {
      "day": "Today",
      "high": 68,
      "low": 58,
      "condition": "Partly Cloudy"
    }
  ]
}

Authorizations

Authorization
string
header
required

Enter your bearer token (will be replaced with Clerk later)

Query Parameters

city
string
default:San Francisco

City name to get weather for

Response

Successful response with weather data

city
string
Example:

"San Francisco"

country
string
Example:

"USA"

temperature
object
condition
string
Example:

"Partly Cloudy"

humidity
number
Example:

72

windSpeed
number
Example:

8

pressure
number
Example:

1013

visibility
number
Example:

10

uvIndex
number
Example:

3

timestamp
string<date-time>
Example:

"2024-11-29T10:30:00Z"

forecast
object[]