# City Context API

> City Context API on Apizie: 3 endpoints (Query by coordinates (SRID 4326 - decimal degrees), Query by postcode, Get usage in current month) returned as clean JSON through one API key. Send your own provider key in the x-upstream-key header. Call it over REST at https://www.apizie.tech/v1/open-data:citycontext/{endpoint} or from Claude, ChatGPT and Cursor through the Apizie MCP server. Free plan: 1,000 requests a month.

- Project key: `open-data:citycontext`
- Category: Open Data
- Status: byok
- Source: https://citycontext.com
- Page: https://www.apizie.tech/api/open-data/citycontext
- OpenAPI: https://www.apizie.tech/api/open-data/citycontext/openapi.json

City Context provides a straightforward API to access UK Open Data: crime statistics, schools, demographics and more.

## Endpoints

### Query by coordinates (SRID 4326 - decimal degrees)
`GET https://www.apizie.tech/v1/open-data:citycontext/by-point` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| lat | number | yes | Latitude |
| lon | number | yes | Longitude |
| school_search_radius | integer | no | Search radius for schools, in metres, between 100 and 4000 |
| park_search_radius | integer | no | Search radius for parks, in metres, between 100 and 2000 |

### Query by postcode
`GET https://www.apizie.tech/v1/open-data:citycontext/by-postcode` (byok)

| Parameter | Type | Required | Description |
|---|---|---|---|
| postcode | string | yes | Postcode |
| school_search_radius | integer | no | Search radius for schools, in metres, between 100 and 4000 |
| park_search_radius | integer | no | Search radius for parks, in metres, between 100 and 2000 |

### Get usage in current month
`GET https://www.apizie.tech/v1/open-data:citycontext/usage` (byok)

## Example
```
curl "https://www.apizie.tech/v1/open-data:citycontext/by-point" \
  -H "x-api-key: $APIZIE_KEY" \
  -H "x-upstream-key: $PROVIDER_KEY"
```

## FAQ

### How do I call the City Context API?
Create a free Apizie key, then send GET https://www.apizie.tech/v1/open-data:citycontext/by-point with the header x-api-key. Every endpoint returns { project, data, timestamp }.

### Is the City Context API free on Apizie?
Yes. The Free plan includes 1,000 requests a month at 100 requests a minute, no credit card. City Context itself also needs your own key from citycontext.com.

### Can AI agents use the City Context API?
Yes. Add the Apizie MCP server (https://www.apizie.tech/mcp) to Claude, ChatGPT, Cursor or VS Code, then ask in plain language. The agent calls run_scraper with project key open-data:citycontext.

### What is the status of the City Context API?
Needs your own provider key (bring your own key)
