# wttr.in API

> Returns current weather, three-day forecast, astronomy times and the nearest named area for a city.

Category: Travel, Maps & Weather. Region: global. 5 endpoints at `https://api.hoshime.com/v1/wttr/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/wttr
## GET /v1/wttr/current

The current weather of a city: temperature, wind, humidity and conditions.

Scope: `social:read` · Units: 1 · Cached: 15 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `city` | string | yes | Place name, such as Jakarta or New York. (e.g. Jakarta) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `area` (Area), `area.country` (string), `area.latitude` (number (double)), `area.longitude` (number (double)), `area.name` (string), `area.region` (string), `cloudCoverPct` (integer (int64)), `description` (string), `feelsLikeCelsius` (integer (int64)), `humidityPct` (integer (int64)), `observationTime` (string), `precipitationMm` (number (double)), `pressureHpa` (integer (int64)), `temperatureCelsius` (integer (int64)), `uvIndex` (integer (int64)), `visibilityKm` (number (double)), `windDirection` (string), `windKmph` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/wttr/current?city=Jakarta" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/wttr/forecast

The daily forecast of a city for the next three days.

Scope: `social:read` · Units: 1 · Cached: 120 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `city` | string | yes | Place name, such as Jakarta or New York. (e.g. Jakarta) |
| `days` | integer | no | Number of days, from 1 to 3. (default 3) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `area` (Area), `area.country` (string), `area.latitude` (number (double)), `area.longitude` (number (double)), `area.name` (string), `area.region` (string), `items` (Day[]), `items[].avgTempCelsius` (integer (int64)), `items[].date` (string), `items[].description` (string), `items[].maxTempCelsius` (integer (int64)), `items[].minTempCelsius` (integer (int64)), `items[].sunrise` (string), `items[].sunset` (string)

```bash
curl "https://api.hoshime.com/v1/wttr/forecast?city=Jakarta" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/wttr/hourly

The forecast of a city every three hours for the next one to three days: temperature, rain chance, wind and conditions.

Scope: `social:read` · Units: 1 · Cached: 120 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `city` | string | yes | Place name, such as Jakarta or New York. (e.g. Jakarta) |
| `days` | integer | no | Number of days, from 1 to 3. Each day has eight three-hour slots. (default 1) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `chanceOfRainPct` (integer (int64)), `date` (string), `description` (string), `feelsLikeCelsius` (integer (int64)), `temperatureCelsius` (integer (int64)), `time` (string), `windDirection` (string), `windKmph` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/wttr/hourly?city=Jakarta" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/wttr/astronomy

Sunrise, sunset, moonrise, moonset and moon phase of a city for the next three days.

Scope: `social:read` · Units: 1 · Cached: 120 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `city` | string | yes | Place name, such as Jakarta or New York. (e.g. Jakarta) |
| `days` | integer | no | Number of days, from 1 to 3. (default 3) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `date` (string), `moonIlluminationPct` (integer (int64)), `moonPhase` (string), `moonrise` (string), `moonset` (string), `sunrise` (string), `sunset` (string)

```bash
curl "https://api.hoshime.com/v1/wttr/astronomy?city=Jakarta" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/wttr/area

The nearest named area wttr.in uses for a city: its coordinates, region and country.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `city` | string | yes | Place name, such as Jakarta or New York. (e.g. Jakarta) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `country` (string), `latitude` (number (double)), `longitude` (number (double)), `name` (string), `region` (string)

```bash
curl "https://api.hoshime.com/v1/wttr/area?city=Jakarta" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
