> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.aegi.run/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.aegi.run/_mcp/server.

# Get detailed current weather information for a city.

GET https://api.aegi.run/v1/tools/weather

Returns current temperature, wind, humidity, pressure, visibility, precipitation, sun schedule and a weather icon for the requested city. All text fields are returned in English.

Reference: https://docs.aegi.run/api-reference/aegis/tools/get-detailed-current-weather-information-for-a-city

## Authentication

- `Authorization` header (bearer token, required) — Create a key at [https://aegi.run](https://aegi.run), then send it as `Authorization: Bearer aegis.<key>`.

## Request

### Query parameters

- `city` (string, required) — Name of the city to search for. A country code can be appended, e.g. "London,GB".

## Response

### 200

Weather successfully retrieved

- `error` (boolean, required) — Indicates if an error occurred
- `data` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaData, required, nullable) — Payload data containing weather details
- `requestId` (string, required) — Unique identifier for the request

## Errors

### 400 Bad Request Error

Bad request

- `error` (ErrorResponseError, required)
- `requestId` (string, optional)

### 404 Not Found Error

City not found

- `error` (ErrorResponseError, required)
- `requestId` (string, optional)

### 500 Internal Server Error

Internal error

- `error` (ErrorResponseError, required)
- `requestId` (string, optional)

## Types

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaData

Payload data containing weather details

- `city` (string, required) — Name of the city
- `country` (string, required) — ISO 3166 country code
- `coordinates` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataCoordinates, required) — Geographical coordinates
- `timezone` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataTimezone, required) — Timezone details of the city
- `observedAt` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataObservedAt, required) — When the weather data was measured
- `temperature` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataTemperature, required) — Temperature details
- `humidity` (double, required) — Humidity percentage
- `pressure` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataPressure, required) — Atmospheric pressure details
- `visibility` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataVisibility, required) — Visibility details
- `cloudiness` (double, required) — Cloudiness percentage
- `wind` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataWind, required) — Wind details
- `precipitation` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataPrecipitation, required) — Precipitation details
- `sun` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataSun, required) — Sun schedule details
- `weather` (V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataWeather, required) — Weather condition details

### ErrorResponseError

- `code` (enum, required)
  - Allowed values: `bad_request`, `unauthorized`, `invalid_api_key`, `api_key_revoked`, `forbidden`, `player_limit`, `not_found`, `method_not_allowed`, `conflict`, `validation_error`, `rate_limited`, `internal_error`, `service_unavailable`
- `message` (string, required)
- `details` (any, optional, nullable)

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataCoordinates

Geographical coordinates

- `lon` (double, required) — Longitude
- `lat` (double, required) — Latitude

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataTimezone

Timezone details of the city

- `offsetSeconds` (double, required) — Shift in seconds from UTC
- `offsetHours` (double, required) — Shift in hours from UTC
- `utc` (string, required) — Offset formatted as UTC±HH:MM

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataObservedAt

When the weather data was measured

- `timestamp` (double, required) — Observation time as Unix timestamp (UTC)
- `utc` (string, required) — Observation time in ISO 8601 (UTC)
- `local` (string, required) — Observation time in the city local time (ISO 8601 without offset)

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataTemperature

Temperature details

- `unit` (enum, required) — Unit used for the temperature values
  - Allowed values: `celsius`
- `current` (double, required) — Current temperature in Celsius
- `currentFahrenheit` (double, required) — Current temperature in Fahrenheit
- `feelsLike` (double, required) — Perceived temperature in Celsius
- `tempMin` (double, required) — Minimum observed temperature at the moment, within the city
- `tempMax` (double, required) — Maximum observed temperature at the moment, within the city

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataPressure

Atmospheric pressure details

- `sea` (double, required) — Atmospheric pressure at sea level in hPa
- `ground` (double, required, nullable) — Atmospheric pressure at ground level in hPa

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataVisibility

Visibility details

- `meters` (double, required, nullable) — Visibility in metres (max 10000)
- `kilometers` (double, required, nullable) — Visibility in kilometres

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataWind

Wind details

- `speed` (double, required) — Wind speed in m/s
- `speedKmh` (double, required) — Wind speed in km/h
- `gust` (double, required, nullable) — Wind gust in m/s
- `deg` (double, required) — Wind direction in degrees
- `direction` (string, required) — Wind direction as a compass point

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataPrecipitation

Precipitation details

- `rainLastHour` (double, required) — Rain volume in the last hour in mm
- `snowLastHour` (double, required) — Snow volume in the last hour in mm

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataSun

Sun schedule details

- `sunrise` (double, required) — Sunrise time as Unix timestamp
- `sunset` (double, required) — Sunset time as Unix timestamp
- `sunriseUtc` (string, required) — Sunrise time in ISO 8601 (UTC)
- `sunsetUtc` (string, required) — Sunset time in ISO 8601 (UTC)
- `sunriseLocal` (string, required) — Sunrise time in the city local time
- `sunsetLocal` (string, required) — Sunset time in the city local time
- `daylightSeconds` (double, required) — Total daylight duration in seconds
- `isDaytime` (boolean, required) — Whether it is currently daytime in the city

### V1ToolsWeatherGetResponsesContentApplicationJsonSchemaDataWeather

Weather condition details

- `id` (double, required) — Weather condition id
- `main` (string, required) — Main weather condition (e.g., Clear, Rain)
- `description` (string, required) — Detailed description of the weather
- `icon` (string, required) — Icon name, without extension
- `iconUrl` (string, required) — Direct URL to the weather icon

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "error": false,
  "data": {
    "city": "São Paulo",
    "country": "BR",
    "coordinates": {
      "lon": -46.6333,
      "lat": -23.5505
    },
    "timezone": {
      "offsetSeconds": -10800,
      "offsetHours": -3,
      "utc": "UTC-03:00"
    },
    "observedAt": {
      "timestamp": 1718200800,
      "utc": "2024-06-12T14:00:00Z",
      "local": "2024-06-12T11:00:00"
    },
    "temperature": {
      "unit": "celsius",
      "current": 22.4,
      "currentFahrenheit": 72.3,
      "feelsLike": 23.1,
      "tempMin": 19.8,
      "tempMax": 24.6
    },
    "humidity": 72,
    "pressure": {
      "sea": 1013.2,
      "ground": 934.5
    },
    "visibility": {
      "meters": 10000,
      "kilometers": 10
    },
    "cloudiness": 40,
    "wind": {
      "speed": 3.6,
      "speedKmh": 12.96,
      "gust": 5.2,
      "deg": 220,
      "direction": "SW"
    },
    "precipitation": {
      "rainLastHour": 0.5,
      "snowLastHour": 0
    },
    "sun": {
      "sunrise": 1718175240,
      "sunset": 1718214360,
      "sunriseUtc": "2024-06-12T07:14:00Z",
      "sunsetUtc": "2024-06-12T18:06:00Z",
      "sunriseLocal": "2024-06-12T04:14:00",
      "sunsetLocal": "2024-06-12T15:06:00",
      "daylightSeconds": 39120,
      "isDaytime": true
    },
    "weather": {
      "id": 802,
      "main": "Clouds",
      "description": "scattered clouds",
      "icon": "partly-cloudy",
      "iconUrl": "https://api.aegi.run/v1/icons/weather/partly-cloudy.png"
    }
  },
  "requestId": "req_a3f7c2e1b84d9056ef123abc45678def"
}
```

**SDK Code**

```python
import requests

url = "https://api.aegi.run/v1/tools/weather"

querystring = {"city":"São Paulo"}

payload = {}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.aegi.run/v1/tools/weather?city=S%C3%A3o+Paulo';
const options = {
  method: 'GET',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.aegi.run/v1/tools/weather?city=S%C3%A3o+Paulo"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.aegi.run/v1/tools/weather?city=S%C3%A3o+Paulo")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.aegi.run/v1/tools/weather?city=S%C3%A3o+Paulo")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.aegi.run/v1/tools/weather?city=S%C3%A3o+Paulo', [
  'body' => '{}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.aegi.run/v1/tools/weather?city=S%C3%A3o+Paulo");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.aegi.run/v1/tools/weather?city=S%C3%A3o+Paulo")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```