canonical: https://jentic.com/apis/apixu.com/apixu

# APIXU Weather API

Jentic publishes the only available OpenAPI specification for APIXU Weather API, keeping it validated and agent-ready. APIXU provides current weather, multi-day forecasts, location autocomplete search, and historical weather data for any location worldwide. The service has been rebranded as Weatherstack but the original APIXU endpoints remain documented here, returning JSON or XML for integrators that depend on the legacy contract. Authentication is by API key passed as a query parameter on every request.

## For AI agents

Look up current weather, forecasts, location search, and historical weather for any location through the legacy APIXU/Weatherstack endpoints.

## Scope

Does not handle weather alerts, radar imagery, marine forecasts, or air quality - use for current weather, forecasts, location search, and historical observations only.

## Capabilities

- Fetch real-time current weather for a location via GET /current.json
- Retrieve multi-day weather forecasts via GET /forecast.json
- Autocomplete or fuzzy-search locations by name with GET /search.json
- Pull historical weather observations for a date range via GET /history.json
- Return either JSON or XML for the same query, supporting legacy XML pipelines

## Use cases

### Field Service Routing

Field service dispatchers fetch the current weather and tomorrow's forecast for each job site so that outdoor work can be reordered ahead of incoming storms. GET /current.json gives the live conditions and GET /forecast.json projects the next several days, both keyed by city name or coordinates so the dispatcher does not need a separate geocoding pass.

Example prompt: Call GET /current.json with q set to the job site postcode, return temperature and precipitation, and reorder jobs if the forecast shows storms within 24 hours.

### Travel Itinerary Enrichment

Travel platforms enrich each itinerary with the forecast for the destination so travellers can pack appropriately and adjust plans. GET /forecast.json returns the multi-day outlook for the destination city while GET /search.json lets users disambiguate cities that share a name.

Example prompt: Call GET /search.json with the user's destination text, pick the matching location, then call GET /forecast.json for that location to return a 5-day outlook.

### Historical Weather Analytics

Insurance and agriculture analysts query historical weather to model claim patterns and crop risk. GET /history.json returns observations for a chosen date and location, and the JSON shape can feed directly into a notebook or BI tool without scraping a web page.

Example prompt: Call GET /history.json with q set to the farm location and dt set to the storm date, returning rainfall and wind data for the claim record.

### AI Agent Weather Lookup

An AI assistant answering 'what's the weather in Berlin?' or 'will it rain at my outdoor meeting tomorrow?' can use Jentic to call APIXU without managing the query-parameter API key directly. Jentic returns the matching operation by intent and injects the credential at call time, so the agent only has to choose between current, forecast, or history.

Example prompt: Search Jentic for 'get current weather', load the GET /current.json schema, and execute it with q set to the user's city to return temperature and conditions.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/current.json` | Get current weather for a location. |
| GET | `/forecast.json` | Get a multi-day weather forecast. |
| GET | `/search.json` | Search or autocomplete a location name. |
| GET | `/history.json` | Get historical weather observations for a date. |
| GET | `/current.xml` | Current weather in XML format for legacy consumers. |
| GET | `/forecast.xml` | Forecast in XML format for legacy consumers. |

## Key resources

- **Current Weather** — Real-time weather for a location in JSON or XML; covers temperature, conditions, wind, and humidity.
- **Forecast** — Multi-day weather forecast for a location, returned in JSON or XML.
- **Search** — Autocomplete and fuzzy search for location names to recover a unique identifier.
- **History** — Historical weather observations for a given location and date.

## Why Jentic

- **Setup:** Wiring APIXU by hand means learning its key-as-query-parameter scheme, which is easy to leak in logs, and choosing between the JSON and XML response variants yourself. Through Jentic you install once, import the APIXU Weather API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** You choose which APIXU operations the agent may call, so you can limit it to the ones it needs, such as current weather and forecast lookups, and leave out history or search if it does not need them. The rule is a positive allow-list, so the agent only runs the operations you have added.
- **Credential handling:** Your APIXU key is stored once, encrypted, by your own Jentic One instance and appended to outbound requests at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'get current weather' or 'historical weather lookup', and Jentic returns the matching APIXU operation with its query-parameter schema so the agent calls the right endpoint without reading the APIXU docs.

## Related APIs

- **OpenWeatherMap API** — Widely used weather data provider with a deeper free tier and broader endpoint surface.
- **WeatherAPI.com** — Modern weather API from the same lineage as APIXU/Weatherstack with marine and astronomy data.
- **Factorial HR API** — Pair weather lookups with employee location data when calculating travel or attendance impact.

## FAQ

### Why is there no official OpenAPI spec for APIXU Weather API?

APIXU does not publish an OpenAPI specification - its reference is rendered as HTML at apixu.com/doc/request.aspx and the service has since rebranded as Weatherstack. Jentic generates and maintains this spec so that AI agents and developers can call APIXU Weather API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the APIXU Weather API use?

APIXU uses an API key passed as the query parameter named key on every request. There is no header-based auth and no OAuth flow. Through Jentic the key is stored encrypted in the vault and appended at call time, so it never enters the agent's prompt or appears in logs.

### Can I get weather alerts or radar imagery from this API?

No. The APIXU surface here exposes current conditions, forecast, search, and history only. Severe-weather alerts and radar tiles are not part of this API; for those use cases the Weatherstack successor or another vendor is required.

### What are the rate limits for the APIXU API?

Rate limits are not declared in the OpenAPI spec - they depend on the APIXU/Weatherstack plan tier. The free and starter tiers historically capped monthly call volume rather than per-second throughput, so cache responses for repeated queries against the same city.

### How do I get current weather through Jentic?

Run pip install jentic, then search Jentic for 'get current weather', load the schema for GET /current.json, and execute it with q set to the city name or 'lat,lon' coordinates. Jentic appends the API key from your stored credentials. Run it through Jentic One, the self-hosted execution layer.

### Can I get JSON and XML from the same API call?

No, but parallel endpoints exist. GET /current.json and GET /current.xml return the same data in their respective formats; GET /forecast.json and GET /forecast.xml do the same for forecasts. Pick the format-specific endpoint that matches your downstream consumer rather than negotiating content type.

### Can I limit what my agent is allowed to do with the APIXU Weather API?

Yes. Because you run your own self-hosted Jentic One instance, you decide which APIXU operations the agent may call, and it works as a positive allow-list, so the agent can only run the operations you have added. You can restrict it to just current weather (GET /current.json) and forecast lookups (GET /forecast.json) while leaving out location search (GET /search.json) and historical observations (GET /history.json) if it does not need them. Your APIXU key stays with your own instance and is appended at call time, so your rules alone determine what the agent can reach.
