WEATHER

API Icon

Documentation

Welcome to our API Documentation! Our API provides real-time weather information for cities around the world. You can use our API to retrieve data such as temperature, humidity, wind speed, and more. Below, we provide examples in various programming languages to show how you can interact with our API to get weather information for any city. Each example demonstrates how to make a request to our API and handle the response.

API Icon

Endpoint

The base URL for accessing weather information is:

https://skyweather.pages.dev/?city=Mogadishu

To use our API, simply make a GET request to the previous API key by replacing {Mogadishu} with the name of the city you want to get weather data for. The response will include details like temperature, humidity, weather conditions, and more. Below are code examples in different programming languages that illustrate how to use our API effectively.

import requests

def get_weather(city):
    response = requests.get(f'https://skyweather.pages.dev/?city={city}')
    return response.json()

print(get_weather('Mogadishu'))

POSSIBLE RESPONSES FOR THE

API Icon

The API provides weather information for a given city. When you make a request to the API with a city name, it returns a JSON object with detailed weather data. Here's a breakdown of the different possible responses:


API Request Example:

https://skyweather.pages.dev/?city=Mogadishu

Successful Response (200 OK)

When the API request is successful and the city is found, the response will be in the following format:

{
  "success": true,
  "timestamp": "2024-11-04/23:30:56 UTC+3",
  "developer": {
    "website": "https://apitools.pages.dev"
  },
  "source": "Weather API",
  "data": {
    "city": "string",
    "country": "string",
    "temperature": "string",
    "feels_like": "string",
    "weather": "string",
    "humidity": "string",
    "wind_speed": "string",
    "cloud_coverage": "string"
  },
  "processingTime": "string"
}
}

The response includes the following information:


Error Responses (400, 404, 500)

If there is an issue with the request, the API may return the following error messages: