# AllEvents API Documentation Find events, cities and organizers from AllEvents: 200M+ events across 40K+ cities and towns. The API is read-only. Every request returns JSON. **Base URL** ``` https://developer.allevents.in/v1 ``` ## Contents **Get started** - [Quickstart](#quickstart) - [Authentication](#authentication) - [Key restrictions, expiry and rotation](#key-restrictions-expiry-and-rotation) - [Making requests](#making-requests) - [Responses and errors](#responses-and-errors) - [Credits](#credits) - [Rate limits](#rate-limits) - [Coverage](#coverage) - [Plans and APIs](#plans-and-apis) - [Pagination](#pagination) - [Dates and times](#dates-and-times) - [AI agents and coding assistants](#ai-agents-and-coding-assistants) - [Versioning and deprecation](#versioning-and-deprecation) - [Troubleshooting](#troubleshooting) **API reference** | API | Endpoint | Use it to | |---|---|---| | [List Events by City (Advanced)](#list-events-by-city-advanced) | `/events/list_es` | List a city's events with rich filters. **Recommended for new integrations.** | | [List Events by City](#list-events-by-city) | `/events/list` | List a city's events with basic filters | | [Events by Geo Coordinates](#events-by-geo-coordinates) | `/events/geo` | Find events around a point | | [Events Search](#events-search) | `/events/search` | Search events by keyword | | [Event Details](#event-details) | `/get_event` | Get one event with its full description | | [Events in Batch](#events-in-batch) | `/events/batch` | Sync upcoming events in bulk | | [Events by Organizer](#events-by-organizer) | `/organizer/events` | List one organizer's events | | [Search Organizers](#search-organizers) | `/organizers/search` | Find organizers by name | | [City Suggestions](#city-suggestions) | `/geo/city_suggestion` | Autocomplete city names | **More** - [Ticket links](#ticket-links) - [Field types by API](#field-types-by-api) - [Migrating from the Azure API](#migrating-from-the-azure-api) --- ## Quickstart Make your first call in three steps. **1. Get an API key** in the developer portal. The full key is shown only once, so store it safely. Put it and the base URL in environment variables: ```bash export AE_API_KEY="ae_api_your_key" export AE_BASE_URL="https://developer.allevents.in/v1" ``` **2. Find the exact city.** City names can be ambiguous. Get its `state` and `country` first: ```bash curl "$AE_BASE_URL/geo/city_suggestion?city=New%20York" \ -H "X-API-Key: $AE_API_KEY" ``` **3. List events in that city.** Send the suggestion's `city`, `state` and `country`, and check `error` before you read `data`: ```bash curl "$AE_BASE_URL/events/list_es?city=New%20York&state=NY&country=United%20States&reqRows=10" \ -H "X-API-Key: $AE_API_KEY" ``` ```python import os import requests response = requests.get( f"{os.environ['AE_BASE_URL']}/events/list_es", headers={"X-API-Key": os.environ["AE_API_KEY"]}, params={"city": "New York", "state": "NY", "country": "United States", "reqRows": 10}, timeout=45, ) body = response.json() if body.get("error", 0) > 0: print("No results:", body["message"]) else: for event in body["data"]: print(event["eventname"], event["start_at"], event["event_url"]) ``` --- ## Authentication Send your key in the `X-API-Key` header on every request: ``` X-API-Key: ae_api_your_key ``` - Keys in the query string are not accepted. - Keep the key on your server. Don't commit it to a repository. - A key used in browser code needs [allowed websites](#key-restrictions-expiry-and-rotation) and only the APIs it needs. --- ## Key restrictions, expiry and rotation Limit each key on the API keys page. Every setting is optional: a key without settings works from anywhere, for every API your plan includes. Changes apply from the next call. | Setting | Rule | Error on a mismatch | |---|---|---| | Allowed IP addresses | Up to 20 IPv4 or IPv6 addresses or CIDR ranges, such as `203.0.113.7`, `198.51.100.0/24` or `2001:db8::/32` | `403` [`ip_not_allowed`](#error-ip_not_allowed) | | Allowed APIs | A subset of the APIs your plan includes | `403` [`api_not_allowed_for_key`](#error-api_not_allowed_for_key) | | Allowed websites | Up to 20 sites: `example.com` (that host only), `*.example.com` (its subdomains, not `example.com`), `localhost:3000`. The `Origin` header must match, or `Referer` when there is no `Origin`. | `403` [`origin_not_allowed`](#error-origin_not_allowed) | | Expiry | Never, 30, 90 or 365 days, or a date (the key stops at the end of that day, UTC) | `401` [`key_expired`](#error-key_expired) | The page also shows each key's last use and its calls in the last 24 hours. ### Calling from a browser Only keys with allowed websites get CORS headers: a matching `Origin` gets `Access-Control-Allow-Origin` for that origin, and preflight (`OPTIONS`) requests are answered. Other keys get no CORS headers, so they work only server-side. Anyone can read a key in browser code, so give a browser key as few APIs as possible. ### Rotating a key Rotate a key from its menu on the API keys page. The new key has the same name and restrictions. The old key keeps working for the overlap you pick (1 hour, 24 hours or 7 days; default 24 hours) and shows "Expires in …", then fails with `key_expired`. If it already expires sooner, it keeps its own date. 1. Rotate the key and copy the new one. 2. Deploy your app with the new key. 3. Wait until the old key's "Last used" stops changing. You can revoke it early. --- ## Making requests Every API accepts `GET` and `POST`, with parameters in any of these forms: | Form | Example | |---|---| | Query string | `GET /events/list_es?city=New%20York&state=NY&country=United%20States` | | Form body | `POST /get_event` with `event_id=8000001234509` as `application/x-www-form-urlencoded` | | JSON body | `POST /events/search` with `{"query": "festival", "city": "Austin"}` as `application/json` | - A parameter sent in more than one form: the JSON body wins, then the form body, then the query string. - A body must be `application/json` or `application/x-www-form-urlencoded` (`multipart/form-data` also works and is read as a form; files are ignored). A `POST` with a body of any other type, or with no `Content-Type`, gets `415` [`unsupported_media_type`](#error-unsupported_media_type). An empty body is fine with any type. - A JSON body must be an object (`{...}`). Anything else is ignored, as are JSON arrays as values. - Send single values. For multi-value filters, send a comma-separated string: `category=music,workshops`. A JSON array value (`"city": ["x"]`) is ignored. - Names with brackets (`city[]=x`), names starting with a space, and `route` are refused with `400` [`invalid_param`](#error-invalid_param). - Unknown parameters are ignored without an error. Check each name: the page size is `reqRows`, `rows` or `count`, depending on the API. --- ## Responses and errors How to read a response, and what each error means. ```json { "message": "", "error": 0, "data": [], "count": 0, "credits_used": 0 } ``` | API | Body | |---|---| | [List Events by City (Advanced)](#list-events-by-city-advanced), [List Events by City](#list-events-by-city), [Events by Geo Coordinates](#events-by-geo-coordinates), [Events by Organizer](#events-by-organizer) | `message`, `error`, `data` (a list of events), `count` (events in `data`), `credits_used` | | [Events Search](#events-search) | `message`, `error`, `data` (a list of events), `credits_used` | | [Event Details](#event-details) | `error`, `message`, `data` (one event, or `false`), `credits_used` | | [Events in Batch](#events-in-batch) | `error`, `message`, `result_count`, `next_cursor`, `data`, `has_more`, `credits_used` | | [Search Organizers](#search-organizers) | `message`, `error`, `data` (a list of organizers), `credits_used` | | [City Suggestions](#city-suggestions) | `data` (a list of cities), `credits_used` | - **`credits_used`** is what this call cost, the same as the `X-Credits-Used` header: `0` for a cached answer, an empty result or an error. See [Credits](#credits). - **Check `error` as well as the HTTP status.** Some requests that find nothing return `200` with `error` above `0`. Treat `error > 0` as "no usable result". Exceptions: [Search Organizers](#search-organizers) and [City Suggestions](#city-suggestions) return `200` with an empty `data` list. - `message` is for people and may change. Don't build logic on it, except `END_OF_RESULTS` and `NO_COVERED_EVENTS_YET` in [Events in Batch](#events-in-batch). - **Ended events are never returned**, nor hidden, draft or archived ones. So a page can be shorter than the page size, and [Event Details](#event-details) answers `404` for an ended event. - Links to AllEvents pages (`event_url`, `tickets.ticket_url`, `organizer.url`, and the `url` of organizers and cities) end with `utm_source=ae_api&utm_medium=api&utm_campaign=`, where the code is 6 characters that identify your account and key. Keep them when you show or store a link. Image links have none. The examples here use the code `k7f2qa`. - Text is plain UTF-8, emojis included; HTML entities are already decoded, so escape text yourself when you put it in HTML. A field an API doesn't send is left out, and a missing value is `null` (never `""` or `0`). In descriptions, emails, phone numbers and links are partly masked (such as `63511xxxxx`), and `description.html` is sanitized: only common formatting tags, no scripts, event handlers or links to other sites. ### HTTP status codes | Status | Meaning | |---|---| | `200` | Processed. Check `error` for "no results" or "outside your coverage". | | `400` | A parameter is missing, invalid or no longer supported (` is not supported in v1.`), the page is too deep, or the city was not found. Fix the request using `message`. A bad parameter name gets [`invalid_param`](#error-invalid_param). | | `401` | Key problem: [`invalid_key`](#error-invalid_key), [`key_expired`](#error-key_expired) | | `402` | No credits to pay for the call: [`credits_exhausted`](#error-credits_exhausted), [`trial_ended`](#error-trial_ended), [`plan_expired`](#error-plan_expired) | | `403` | Not allowed: [`account_inactive`](#error-account_inactive), [`endpoint_not_allowed`](#error-endpoint_not_allowed), [`ip_not_allowed`](#error-ip_not_allowed), [`api_not_allowed_for_key`](#error-api_not_allowed_for_key), [`origin_not_allowed`](#error-origin_not_allowed) | | `404` | The API, event or organizer was not found. Check the URL or ID. An unknown API path gets [`unknown_api`](#error-unknown_api). | | `415` | The request body isn't JSON or a form: [`unsupported_media_type`](#error-unsupported_media_type) | | `429` | [`rate_limited`](#error-rate_limited) | | `5xx` | Temporary failure on our side: [`service_unavailable`](#error-service_unavailable), [`upstream_unavailable`](#error-upstream_unavailable), or a `503` without a `code` (`{"error":1,"message":"Something went wrong. Try again shortly.","credits_used":0}`) from the data source. Nothing is charged. Retry with backoff, after `Retry-After` seconds when it's sent. | ```json { "error": 1, "code": "credits_exhausted", "message": "You've used all your credits for this period. Cached answers stay free; fresh calls need credits. Upgrade to Growth for more: https://…/billing", "upgrade": { "plan": "GROWTH", "name": "Growth", "url": "https://…/billing", "action": "upgrade" }, "credits_used": 0 } ``` - `code` is sent only for the errors below. Every error with a `code` also has `"credits_used": 0` (last) and `X-Credits-Used: 0`. - `402` errors also have `upgrade`: the plan that lifts the limit and where to get it. `action` is `upgrade`, `renew` or `book_a_call` (Enterprise). - A `429` body has only `error`, `code`, `message` and `credits_used`. - Other errors have no `code`: `{"error": 1, "message": "…", "credits_used": 0}`, sometimes with the API's normal fields, such as `data`. Validation errors are `400`, such as ` is required.`, `page cannot be negative.` or ` is not supported in v1.` ### Error codes Every error with a `code` costs 0 credits. #### invalid_key {#error-invalid_key} `401`. The key is missing, invalid or revoked. Send it in the `X-API-Key` header (not the query string) and check it's active on the API keys page. A revoked key can't be restored: create a new one. An expired key gets [`key_expired`](#error-key_expired). #### key_expired {#error-key_expired} `401`. The key's expiry date passed, or it was rotated and the overlap ended. Use its replacement or create a new key. It works again only if you change its expiry. Message: "This API key has expired. Create a new key on the Keys page." #### invalid_param {#error-invalid_param} `400`. A parameter name has brackets (`city[]=x`), starts with a space, or is `route`. Use plain names and single values, such as `category=music,workshops`. #### missing_param {#error-missing_param} `400`. A required parameter is missing or empty; `message` names it ("country is required."). Each API's parameter table marks the required ones. #### unknown_api {#error-unknown_api} `404`. No API at this path or version. Check the path against the [API reference](#api-reference) and the version (`/v1/`). #### unsupported_media_type {#error-unsupported_media_type} `415`. The `POST` body has a `Content-Type` the API doesn't read (for example `text/plain`), or none. Send the parameters in the query string, or as an `application/json` or `application/x-www-form-urlencoded` body. #### credits_exhausted {#error-credits_exhausted} `402`. No credits left for this billing period. Cached answers still work. Upgrade, buy extra credits or wait for renewal; `upgrade` names the plan that lifts the limit. #### trial_ended {#error-trial_ended} `402`. Your free trial's credits are used, or you haven't claimed them yet (a new account has 0 credits until you claim them on the Billing page). Every call stops, cached ones too. Claim your free credits or pick a plan. #### plan_expired {#error-plan_expired} `402`. Your paid plan expired and nothing is left to pay for the call: top-up credits are used, and either today's 100 grace credits are used or the 3 grace days are over. Renew your plan. Until then responses carry `X-Plan-Status: expired` (see [Credits](#credits)). #### account_inactive {#error-account_inactive} `403`. The account is not active. Check your account and billing, or contact support with the call's `X-Request-Id`. #### endpoint_not_allowed {#error-endpoint_not_allowed} `403`. Your plan doesn't include this API. Upgrade, or use an API your plan includes. See [Plans and APIs](#plans-and-apis). #### ip_not_allowed {#error-ip_not_allowed} `403`. The call came from an IP the key doesn't allow; `message` names the IP we saw. Add the IP or its CIDR range (`203.0.113.0/24`, `2001:db8::/32`) to the key. Behind a proxy or NAT we see the last hop's public address. #### api_not_allowed_for_key {#error-api_not_allowed_for_key} `403`. The key is limited to other APIs. Add this API to the key or use another key. (Your plan may include it; [`endpoint_not_allowed`](#error-endpoint_not_allowed) is the plan-level error.) #### origin_not_allowed {#error-origin_not_allowed} `403`. The key has allowed websites, and the call came from another site or had no `Origin` or `Referer` (for example from a server or `curl`). Add the site to the key. For server calls, use a key without website restrictions. #### rate_limited {#error-rate_limited} `429`. Too many requests in this window. Wait `Retry-After` seconds, then retry, or upgrade for higher limits. See [Rate limits](#rate-limits). Many calls with invalid keys from one IP also get `429` ("Too many requests with invalid API keys. Try again after ~45s.") with `Retry-After`; fix the key. These don't count against your limits. #### service_unavailable {#error-service_unavailable} `503`. The API is briefly unavailable on our side (for example while the store that counts credits and limits can't be reached). Nothing is charged and nothing is counted. Retry after `Retry-After` seconds, with backoff. #### upstream_unavailable {#error-upstream_unavailable} `503`. The data source didn't answer in time or failed. Nothing is charged. Retry with backoff; send the `X-Request-Id` to support if it keeps happening. --- ## Credits A call that returns data costs credits, however many results it returns. **How many credits each API costs is shown in the portal (Usage and Billing pages)**, and every answer says what it cost. These cost 0: - No results, or outside your coverage - A cached answer (`X-Cache: HIT`) - Any `4xx` or `5xx` error - A response with an empty body - [Events in Batch](#events-in-batch) answering `NO_COVERED_EVENTS_YET` The body's `credits_used` says what the call cost. Every response has these headers: | Header | Meaning | |---|---| | `X-Credits-Used`, `X-Credits-Charged` | Credits charged for this call, the same as `credits_used` | | `X-Credits-Limit` | Credits in your current period | | `X-Credits-Remaining` | Credits left | | `X-Request-Id` | ID of this request. Include it when you contact support. | | `X-Plan-Status` | `expired` once your paid plan has expired, with `X-Plan-Warning`. Calls then use your top-up credits, then 100 grace credits a day for 3 days (`X-Grace-Day`: `1 of 3` …, and `X-Grace-Ends`). | ### Cached answers Repeating a call with the same parameters (in any order) within 1 hour gets a cached answer: **0 credits** and fast. For [Event Details](#event-details) and [Events in Batch](#events-in-batch) (cached per `next_cursor`) the window is 10 minutes, since those answers change more often. Only answers with data are cached: errors, empty results and answers outside your coverage never are, so a retry always gets a fresh answer. A cached answer says what it cost: `credits_used` in the body and `X-Credits-Used` are both `0`. | Header | Meaning | |---|---| | `X-Cache` | `HIT` (cached), `MISS` (fresh) or `BYPASS` (fresh because of `cached=false`) | | `Age`, `X-Cache-Age` | Seconds since a cached answer was fetched | | `X-Cache-Source: shared` | With `MISS`: the same request was fetched moments ago (at most 1 hour, see `Age`). Charged like a fresh call. | Every API takes `cached`: - `cached=true` (default) allows a cached answer. - `cached=false` always fetches fresh data, as does `Cache-Control: no-cache`. It's charged and refreshes the cache for the next call. - `false`, `0` and `no` mean false. Any other value means `true`. - `cached` isn't passed to the data source and doesn't change which answer is cached. Send `Accept-Encoding: gzip` (most clients do) to get cached answers compressed. --- ## Rate limits Your plan sets limits per minute and per day (the free trial also has an hourly limit). Your limits and usage are on the Usage page. - Paid plans have separate, higher limits for cached answers. On the free trial, fresh and cached calls share one set. - Every answered request counts, even at 0 credits. A request refused with `429` doesn't. - Windows are fixed: a minute starts at :00, a day at 00:00 UTC. - Over a limit you get `429` [`rate_limited`](#error-rate_limited): "You hit your rate limit. Try again after ~1h5m or upgrade your plan to get higher rate limits." Wait `Retry-After` seconds, then retry. --- ## Coverage Your plan sets the countries, states and cities you can read, or everywhere. | You request | What happens | |---|---| | A place outside your coverage | `200` with `error: 1` and `"This city is not in your coverage."`, 0 credits | | [Events by Geo Coordinates](#events-by-geo-coordinates) around a point outside your coverage | `200` at once, with `error: 1` and `"This location is not in your coverage."`, 0 credits | | One event outside your coverage | `200` with `error: 1` and `"This event is out of your API Scope."`, 0 credits | | A list with no place named | Only events in your coverage are returned | - An event is also covered if its venue is within 25 km of the center of a covered city in the same country, which includes suburbs and other spellings. - With limited coverage, a page can be **short or empty even when more results exist**. [Events by Geo Coordinates](#events-by-geo-coordinates), [Events Search](#events-search) and [Events by Organizer](#events-by-organizer) without `city` check up to 1,000 source rows per request. --- ## Plans and APIs Not every plan includes every API, and the response fields of an API can differ by plan. - Each API in the [API reference](#api-reference) shows the plans that include it today ("Available on"), read live from our plans. The [APIs by plan](/docs) table at the top of the docs page shows all of them at once. Plans can change, so check there rather than copying a list. - An API outside your plan answers `403` [`endpoint_not_allowed`](#error-endpoint_not_allowed), with 0 credits. - When a plan returns fewer fields for an API, its "Available on" box lists the difference. Read fields defensively: a field that isn't in your plan is left out of the answer, not sent empty. - Your own plan's APIs are on the API keys page and in the Playground. --- ## Pagination Page size, default and maximum by API: | API | Style | Page size parameter | Default | Maximum | |---|---|---|---|---| | `/events/list_es` | Page | `reqRows` | 10 | 10 | | `/events/list` | Page | `reqRows` | 10 | 10 | | `/events/geo` | Page | `rows` | 10 | 10 | | `/events/search` | Page | `rows` | 10 | 10 | | `/organizer/events` | Page | `count` | 10 | 10 | | `/organizers/search` | Page | None | 10 | 10 | | `/events/batch` | Cursor | `count` (1 to 1000) | 1000 | 1000 | - `page` starts at **0**. - Every API returns **at most 10 results per call**, except [Events in Batch](#events-in-batch) (up to 1,000). A page size above 10 becomes 10; zero, negative or non-numbers use 10. Use `page` to get more. - Pages can't go deeper than `(page + 1) × page size` = **10,000** results on [List Events by City (Advanced)](#list-events-by-city-advanced) and [List Events by City](#list-events-by-city), or **1,000** on [Events by Geo Coordinates](#events-by-geo-coordinates), [Events Search](#events-search) and [Search Organizers](#search-organizers). A deeper page answers `400`. Narrow the filters instead. - A short page isn't the last page. Stop when a page comes back with no data. --- ## Dates and times - **Request dates** (`sdate`, `edate`) are best sent as `YYYY-MM-DD` (relative forms such as `next friday` are also read), as whole days in the event's city. - **`start_at` and `end_at`** are the venue's local date and time in ISO 8601, with its UTC offset: `2026-12-05T19:00:00-06:00` starts at 19:00 at the venue. An event without an end time has `end_at` equal to `start_at`. To show the venue's time, show the date and time as written; don't convert them to the viewer's time zone unless you mean to. - **`start_ts` and `end_ts`** are the same moments as Unix seconds, real UTC: `2026-12-05T19:00:00-06:00` is `1796518800` (01:00 UTC on 6 December). Use them to sort, compare and count down. - **`timezone`** is the venue's UTC offset as `±HH:MM` (`-06:00`, `+05:30`, `+00:00`), on every event item. - **`label`** is `ongoing` (started, not over), `today`, `tomorrow` or `upcoming`, on the venue's calendar (an event with several dates by its next date), as of when the answer was made (a [cached answer](#cached-answers) can be up to an hour old). - **`display.short` and `display.full`** are ready-made text in the venue's time, such as `Sat, 5 Dec • 7:00PM to 10:00PM` and `Sat, 5 Dec 2026 • 7:00 PM to 10:00 PM (CST)`. Show them; don't parse them. - **Events with several dates** have `schedule.has_multiple_dates: true`, `schedule.next_date` (the next date, ISO 8601, or `null` when none is upcoming) and `schedule.upcoming_dates` (how many are left; `1` for a one-time event). `start_at` is then the start of the series and can be in the past, and `end_at` is the end of the last date. [Event Details](#event-details) and [Events in Batch](#events-in-batch) also list every upcoming date in `schedule.dates`. - **Ended events are never returned.** An event has ended when `end_ts` is before now. Drop stored events at that moment too. --- ## AI agents and coding assistants The docs in forms tools can read without running JavaScript: | URL | What it is | |---|---| | `https://developer.allevents.in/docs.md` | These docs as one Markdown file | | `https://developer.allevents.in/llms.txt` | Short index for language models ([llmstxt.org](https://llmstxt.org) format) | | `https://developer.allevents.in/llms-full.txt` | Full docs as plain text | | `https://developer.allevents.in/openapi.json` | OpenAPI 3.1: endpoints, parameters and error codes | The docs page has a setup prompt for Claude Code, Codex, Cursor, Windsurf, GitHub Copilot, OpenCode, Gemini CLI and Cline. It never contains your key. There is no MCP server. Rules for generated code: - Read the key from an environment variable such as `AE_API_KEY`. Never put a real key in a prompt, code, tests or logs. - Call the API only from server-side code. - Check `error` as well as the HTTP status. On `429`, wait `Retry-After` seconds. - Calls that return data cost credits (see the portal's Usage and Billing pages); no data, errors and cached answers cost 0. Cache results, and send `cached=false` only when you need fresh data. --- ## Versioning and deprecation The version is in the path: `/v1`. **v1 is stable.** - Changes within v1 are backward compatible: we may add APIs, optional parameters, response fields, headers and error codes. Ignore unknown fields and don't depend on field order. `message` text can change at any time. - Breaking changes (removing or renaming a parameter, field or API, changing a field's type, or changing which status or `code` a request gets) are announced here ahead of time where possible. They ship without notice only to fix a security or abuse problem. - Deprecated items are marked here until removed, with their replacement and the date they stop working. - A `/v2` would be used only for changes that can't be made compatibly, announced here with a migration guide and a period in which both versions work. - A path with a version that doesn't exist returns a JSON `404`. ### Recent changes **24 November 2026: search and batch fixes** - [Events Search](#events-search): `city` is now matched like the list APIs, and new optional `state` and `country` pick the right city. A city that isn't recognized answers `400 Invalid City` (0 credits) instead of being ignored. - [Events in Batch](#events-in-batch): `count` of `0`, a negative or a non-whole number answers `400 count must be between 1 and 1000.` (0 credits). Before, `0` returned 1,000 events. - Coverage changes made in the portal apply to the next call (before: up to 5 minutes), and answers are cached right after a change. **24 November 2026: new response schema (breaking)** - **One fixed Event object on every event API** (see [Response fields](#response-fields)): `event_id`, `eventname`, `event_url`, `start_at`/`end_at` (ISO 8601 with the venue's offset), `start_ts`/`end_ts` (Unix seconds, real UTC), `timezone`, `label`, `display`, `schedule`, `venue` (with `name`; numeric coordinates), `is_online`, `organizer` (`org_id` is now an integer; with `url`), `categories`, `thumb_url`, `banner_url`, `price`, `tickets` (with `provider`) and `description`. [Event Details](#event-details) and [Events in Batch](#events-in-batch) add `video_url`, `schedule.dates`, `description.text`, `description.html` and `updated_at`. Organizers ([Search Organizers](#search-organizers)) and cities ([City Suggestions](#city-suggestions)) have fixed fields too. - **Removed in 2026-11-24:** `eventname_raw`, `owner_id`, `thumb_url_large`, `share_url`, `featured`, `score`, `promo_weight`, `tags`, `custom_params`, `venue_id`, `venue_url`, `start_time`, `end_time`, `start_time_display`, `end_time_display`, every `display_*`, `app_display_*` and `web_display_*` string, `object_type`, `end_url`, `distance`, `recurring_event_details`, `ticket`, `has_slots`, `slots_data` and the body's `request`. Moved: `location` is `venue.name`; `short_description` and `description_html` are in `description`; ticket currency and prices are in `price`; the organizer's `organizer_id` is `org_id`; a city's `region_code` is `state` and `region` is `state_name`. - Every body has `credits_used`, what the call cost (`0` when cached). [Events Search](#events-search) returns only events: no keyword, city or category entries, and no `rows`. - Removed parameters answer `400 is not supported in v1.` (0 credits): `popular` on [List Events by City](#list-events-by-city); `formats`, `formats_op`, `popular`, `featured` and `high_confidence` on [List Events by City (Advanced)](#list-events-by-city-advanced), whose `category` now always matches an event's high-confidence categories. `sort=popular` still works. - Page size is at most 10 on every API (default 10; [Events in Batch](#events-in-batch) `count` 1 to 1,000), and pages can't go past 10,000 results (list APIs) or 1,000 (geo, search, organizers). See [Pagination](#pagination). - [Events in Batch](#events-in-batch): `next_cursor` is an opaque string that changes on every response. Old `c` cursors answer `400 next_cursor is not valid.`: start again without a cursor. Accounts with narrow coverage can get `NO_COVERED_EVENTS_YET` (0 credits): continue with `next_cursor`. - Descriptions are masked (emails, phone numbers and links, such as `63511xxxxx`) and `description.html` is sanitized. Emojis are sent as UTF-8. - [Events by Geo Coordinates](#events-by-geo-coordinates) outside your coverage answers at once: `This location is not in your coverage.`, 0 credits. A failure in the data source answers `503` JSON with `credits_used: 0`. The gateway's own errors also carry `"credits_used": 0` and `X-Credits-Used: 0`. **23 November 2026** - Every API returns at most **10 results per call** (`reqRows`, `rows` or `count` up to 10; the default is now 10). A larger value becomes 10, so existing code keeps working with smaller pages: use `page` for more. [Events in Batch](#events-in-batch) is unchanged (up to 1,000). **19 November 2026** - No API returns ended, draft or hidden events. [Event Details](#event-details) answers `404 Event has ended or is not available`; [Events by Organizer](#events-by-organizer) answers `400` for `past` other than `0`. - `tickets.ticket_url` goes through allevents.in (see [Ticket links](#ticket-links)). `pages/rd` links are no longer returned. - `timezone` is always `±HH:MM`, on every event item except search results. - Removed internal fields from event items: `params`, `ex_params`, `origin_url`, `sort_time`, `buy_ticket`, `rsvp_status`, `spam`, `draft`, `status`, `id`, the top-level `ticket_url` and, in search, `field_weight`. - `organizer` is `null` on events from some imported listings, and [Search Organizers](#search-organizers) doesn't return those organizers. [Events by Organizer](#events-by-organizer) fills `organizer` with the requested organizer. --- ## Troubleshooting Include the call's `X-Request-Id` header when you contact support. | What you see | Cause and fix | |---|---| | `200` with `error` above `0` | Nothing found, or outside your [coverage](#coverage). 0 credits. | | `400 Invalid City` | Send `state`: get `state` and `country` from [City Suggestions](#city-suggestions). | | `400 … is not supported in v1.` | The parameter was removed on 24 November 2026 ([Recent changes](#recent-changes)). Drop it; for popularity use `sort=popular`. | | `400 next_cursor is not valid.` | An old `c` cursor, or a cursor that was changed. Start the sync again without `next_cursor` ([Events in Batch](#events-in-batch)). | | `400` for a deep page | `(page + 1) × page size` is over 10,000 (list APIs) or 1,000 (geo, search, organizers). Narrow the filters ([Pagination](#pagination)). | | A filter does nothing | Unknown parameters are ignored. Check the name, including the page size (`reqRows`, `rows` or `count`). | | A page is shorter than the page size | Normal with limited coverage. Continue until a page is empty ([Pagination](#pagination)). | | An event is missing, or `get_event` answers `404` | It ended or was hidden ([Dates and times](#dates-and-times)). | | Event times are off by hours | Show `start_at` as written, or `display`, for the venue's time; `start_ts` is real UTC ([Dates and times](#dates-and-times)). | | A field you used is missing | It was removed or moved on 24 November 2026 ([Recent changes](#recent-changes)). | | `5xx` | Temporary, never charged. Retry with backoff. | | The same answer keeps coming back | It's cached (`X-Cache: HIT`). Send `cached=false` ([Cached answers](#cached-answers)). | | `429` | Wait `Retry-After` seconds ([Rate limits](#rate-limits)). | | `401`, `402` or `403` with a `code` | See [Error codes](#error-codes). | --- # API reference ## List Events by City (Advanced) Lists events that start in a city, with rich filters and sorting. Each result has the same fixed set of fields. **Use this API for new integrations.** ``` GET | POST /events/list_es ``` ### Parameters **Location** | Parameter | Type | Required | Description | |---|---|---|---| | `city` | string | **Yes** | City name, such as `New York`. | | `state` | string | Recommended | State or region code or name, such as `England` or `NY`. | | `country` | string | **Yes** | Country name or code, such as `United Kingdom`. | | `latitude` | number | No | Limits results to a radius inside the city. Send with `longitude` and `radius`. | | `longitude` | number | No | See `latitude`. | | `radius` | integer | No | Radius in km. Maximum 100. See `latitude`. | > **Send `country`, and `state` whenever you have it.** Without `state`, many cities return `400 Invalid City`. Get both from [City Suggestions](#city-suggestions). **Dates** | Parameter | Type | Default | Description | |---|---|---|---| | `when` | string | | `today`, `tomorrow`, `this_weekend`, `this_week`, `next_week`, `this_month` or `next_month`. Not with `sdate` or `edate`. | | `sdate` | date | Today | First day of the range. Alone, the range is only that day. | | `edate` | date | No end | Last day of the range. Can't be before `sdate`. | Only events that **start** inside the range are returned, not ones already running. Recurring events match on the start of their series, not their next date. **Content** | Parameter | Type | Default | Description | |---|---|---|---| | `category` | comma-separated | | Category slugs, such as `music,workshops`, as in the `categories` response field. Matches the categories we are most confident about for each event. | | `category_op` | `or`, `and` | `or` | Whether an event needs any `category` value, or all of them. | | `keyword` | string | | Every word must appear in the event name, venue name or organizer name. | | `phrase` | string | | This exact phrase must appear in the event name. | | `time_of_day` | comma-separated | | `morning`, `afternoon`, `evening`, `night`. | | `time_of_day_op` | `or`, `and` | `or` | Whether an event needs any `time_of_day` value, or all of them. An event has every part of the day it spans. | **Price** | Parameter | Type | Description | |---|---|---| | `price` | `free`, `paid` | Free or paid events only. | | `min_price` | number | Lowest starting price. Events with no price are left out. | | `max_price` | number | Highest starting price. Events with no price are left out. | | `currency` | 3-letter code | Ticket currency, such as `USD` or `EUR`. Prices aren't converted: send it with a price range. | **Sorting and paging** | Parameter | Type | Default | Description | |---|---|---|---| | `sort` | string | `date` | `date` (soonest first), `popular`, `price_asc`, `price_desc` or `interested` (most interested first). | | `page` | integer | `0` | Page number, starting at 0. `(page + 1) × reqRows` can't exceed 10,000. | | `reqRows` | integer | `10` | Results per page. Maximum 10. `rows` also works; `reqRows` wins. | | `shortDesc` | `1` | Off | Adds `description.short` to each event. | | `cached` | boolean | `true` | `false` fetches fresh data. See [Cached answers](#cached-answers). | > `formats`, `formats_op`, `popular`, `featured` and `high_confidence` were removed on 24 November 2026. Sending one answers `400 is not supported in v1.` (0 credits). Use `sort=popular` instead of `popular=1`. ### How filters combine Different filters combine with AND. The `_op` parameters only control the values inside one filter: ``` category=music,workshops music OR workshops category=music,workshops&category_op=and music AND workshops category=music,workshops&time_of_day=evening&price=free (music OR workshops) AND evening AND free ``` ### Example request ```bash curl "$AE_BASE_URL/events/list_es?city=Austin&state=TX&country=United%20States&category=music&when=this_month&sort=popular&reqRows=10" \ -H "X-API-Key: $AE_API_KEY" ``` ### Example response ```json { "message": "", "error": 0, "data": [ { "event_id": "80001234567893", "eventname": "Eastside Jazz Night 🎷", "event_url": "https://allevents.in/austin/eastside-jazz-night/80001234567893?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "start_at": "2026-12-05T19:00:00-06:00", "end_at": "2026-12-05T22:00:00-06:00", "start_ts": 1796518800, "end_ts": 1796529600, "timezone": "-06:00", "label": "upcoming", "display": { "short": "Sat, 5 Dec • 7:00PM to 10:00PM", "full": "Sat, 5 Dec 2026 • 7:00 PM to 10:00 PM (CST)" }, "schedule": { "has_multiple_dates": false, "next_date": null, "upcoming_dates": 1 }, "venue": { "name": "Riverside Music Hall", "street": "100 Example Riverside Dr, Austin, TX 78704, United States", "city": "Austin", "state": "TX", "country": "United States", "latitude": 30.2622, "longitude": -97.747, "full_address": "Riverside Music Hall, 100 Example Riverside Dr, Austin, TX 78704, United States" }, "is_online": false, "organizer": { "org_id": 1000000001, "name": "Austin Live Events Co.", "url": "https://allevents.in/org/austin-live-events-co/1000000001?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa" }, "categories": ["music", "jazz", "nightlife"], "thumb_url": "https://example.com/images/sample-thumb.jpg", "banner_url": "https://example.com/images/sample-banner.jpg", "price": { "currency": "USD", "min": 15.0, "max": 20.0, "is_free": false, "label": "USD 15 to 20" }, "tickets": { "has_tickets": true, "ticket_url": "https://allevents.in/manage/tickets/book.php?hide_details=1&event_id=80001234567893&utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "provider": "AllEvents" } } ], "count": 1, "credits_used": 1 } ``` ### Response fields Every event API returns this same Event object: the list APIs, [Events by Geo Coordinates](#events-by-geo-coordinates), [Events Search](#events-search), [Event Details](#event-details), [Events in Batch](#events-in-batch) and [Events by Organizer](#events-by-organizer). Fields marked "Details and Batch" are only in [Event Details](#event-details) and [Events in Batch](#events-in-batch). | Field | Type | Description | |---|---|---| | `event_id` | string | Event ID. Store it as a string. | | `eventname` | string | Event name, plain text (entities decoded) | | `event_url` | string | Event page on AllEvents, with your UTM code | | `start_at`, `end_at` | string | Start and end in the venue's time, ISO 8601 with its offset, such as `2026-12-05T19:00:00-06:00`. `end_at` equals `start_at` when there is no end. See [Dates and times](#dates-and-times). | | `start_ts`, `end_ts` | integer | The same moments as Unix seconds (real UTC) | | `timezone` | string | Venue's UTC offset, `±HH:MM` | | `label` | string | `ongoing`, `today`, `tomorrow` or `upcoming`, on the venue's calendar | | `display` | object | `short` (for cards, up to 35 characters) and `full` (with the time zone and "+ N more"): ready-made date and time text in the venue's time. Show it as is. | | `schedule` | object | `has_multiple_dates` (boolean), `next_date` (ISO 8601 or `null`), `upcoming_dates` (integer or `null`; `0` when none is left). Details and Batch also have `dates`, every upcoming date (ISO 8601). | | `venue` | object | `name`, `street`, `city`, `state` (region code, such as `NY`), `country` (name), `latitude` and `longitude` (number), `full_address` (`Online` for online events). Each can be `null`; coordinates are `null` when missing. | | `is_online` | boolean | Whether the event is online | | `organizer` | object or null | `org_id` (integer), `name`, `url`. `null` for some imported listings that have no public organizer. | | `categories` | string[] | Category slugs. These are the values `category` filters on. Can be empty. | | `thumb_url` | string | Thumbnail image URL. Never `null`. | | `banner_url` | string | Banner image URL, 500×250. Never `null`. | | `video_url` | string or null | Video link. Details and Batch only. | | `price` | object | `currency` (3-letter code), `min` and `max` (number or `null`), `is_free` (boolean or `null`), `label` (such as `Free`, `INR 1,500` or `USD 15 to 20`). All `null` when the event has no price. | | `tickets` | object | `has_tickets` (boolean, `true` when tickets are sold through AllEvents), `ticket_url` (never `null`) and `provider` (such as `AllEvents`, `Eventbrite`, `Ticketmaster`, `BookMyShow` or `Organizer`, or `null` when there is no ticket link). See [Ticket links](#ticket-links). | | `description` | object | `short` (up to 300 characters), only with `shortDesc=1` on this API. Details and Batch always have `short`, `text` (plain text) and `html` (sanitized HTML). Each can be `null`. Emails, phone numbers and links are partly masked. | | `updated_at` | string | When the event last changed, ISO 8601 UTC such as `2026-11-20T20:30:55Z`. Details and Batch only. | ### Errors | Status | `message` | Cause | |---|---|---| | `200` | `No events found` | Nothing matched your filters | | `200` | `This city is not in your coverage.` | See [Coverage](#coverage) | | `400` | `city is required.` | `city` is missing | | `400` | `country is required.` | `country` is missing | | `400` | `Invalid City` | City not recognized, or `country` is missing. Send `country`, and add `state` if the error continues. | | `400` | `sdate is not a valid date.` | Bad `sdate` or `edate` | | `400` | `edate must be after sdate.` | The range is reversed | | `400` | `Send either when or sdate/edate, not both.` | Conflicting date filters | | `400` | `price must be free or paid.` | Bad `price` | | `400` | `latitude, longitude and radius must be sent together as numbers.` | Incomplete radius filter | | `400` | `page is beyond the 10000 result limit. Narrow the filters.` | Page too deep | | `400` | `formats is not supported in v1.` | A removed parameter: `formats`, `formats_op`, `popular`, `featured` or `high_confidence`. 0 credits. | | `400` | `page cannot be negative.` | `page` is below 0 | | `400` | `max_price must be >= min_price.` | The price range is reversed | | `400` | Names the allowed values | Bad `sort`, `when`, `min_price`, `max_price`, `currency`, `time_of_day` or an `_op` value, such as `currency must be a 3-letter code, e.g. INR.` | | `503` | `Search is unavailable. Try again shortly.` | Temporary failure. Retry with backoff. | --- ## List Events by City Lists a city's events with basic filters. Existing integrations can keep using it; new ones should use [List Events by City (Advanced)](#list-events-by-city-advanced). ``` GET | POST /events/list ``` ### Parameters | Parameter | Type | Required | Default | Description | |---|---|---|---|---| | `city` | string | **Yes** | | City name | | `state` | string | Recommended | | State or region code or name, such as `England` or `NY` | | `country` | string | **Yes** | | Country name or code, such as `United Kingdom` | | `sdate` | date | No | | Start of the date range | | `edate` | date | No | | End of the date range | | `category` | string | No | | One category, such as `music`. Matched as that category's keywords in the event name, description and tags. | | `shortDesc` | `1` | No | Off | Adds `description.short` | | `page` | integer | No | `0` | Page number, starting at 0. `(page + 1) × reqRows` can't exceed 10,000. | | `reqRows` | integer | No | `10` | Results per page. Maximum 10. `rows` also works; `reqRows` wins. | | `cached` | boolean | No | `true` | `false` fetches fresh data. See [Cached answers](#cached-answers). | > Send `country`, and `state` whenever you have it. Without `state`, many cities return `400 Invalid City`. `popular` was removed on 24 November 2026: it answers `400 popular is not supported in v1.` For popular events, use [List Events by City (Advanced)](#list-events-by-city-advanced) with `sort=popular`. Unlike the Advanced API, this one also returns events **already running** in the range: with `sdate=2026-11-07`, an event from 31 Oct to 8 Nov is included. ### Example request ```bash curl "$AE_BASE_URL/events/list?city=London&state=England&country=United%20Kingdom&reqRows=10" \ -H "X-API-Key: $AE_API_KEY" ``` ### Example response ```json { "message": "", "error": 0, "data": [ { "event_id": "80001234567891", "eventname": "Midnight Food Market & Street Kitchens", "event_url": "https://allevents.in/london/midnight-food-market-and-street-kitchens/80001234567891?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "start_at": "2026-11-27T22:00:00+00:00", "end_at": "2026-12-12T02:00:00+00:00", "start_ts": 1795816800, "end_ts": 1797040800, "timezone": "+00:00", "label": "upcoming", "display": { "short": "From 27 Nov • 10:00PM", "full": "From 27 Nov 2026 • 10:00 PM (GMT) + 2 more" }, "schedule": { "has_multiple_dates": true, "next_date": "2026-11-27T22:00:00+00:00", "upcoming_dates": 3 }, "venue": { "name": "Canal Yard Market Hall", "street": "1 Example Wharf, London N1 9AA, United Kingdom", "city": "London", "state": "England", "country": "United Kingdom", "latitude": 51.5332, "longitude": -0.1052, "full_address": "Canal Yard Market Hall, 1 Example Wharf, London N1 9AA, United Kingdom" }, "is_online": false, "organizer": null, "categories": ["food-drinks", "markets", "nightlife"], "thumb_url": "https://example.com/images/sample-thumb.jpg", "banner_url": "https://example.com/images/sample-banner.jpg", "price": { "currency": "GBP", "min": 5.0, "max": 12.0, "is_free": false, "label": "GBP 5 to 12" }, "tickets": { "has_tickets": false, "ticket_url": "https://allevents.in/pages/link?event_id=80001234567891&ref=ae_api&utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "provider": "Eventbrite" } } ], "count": 1, "credits_used": 1 } ``` ### Response fields Each item in `data` has the same fields as [the Event object](#response-fields) of the Advanced API, with the same types. `description` is sent only with `shortDesc=1`. ### Errors | Status | `message` | Cause | |---|---|---| | `200` | `No events found` | Nothing matched | | `200` | `This city is not in your coverage.` | See [Coverage](#coverage) | | `400` | `city is required.` | `city` is missing | | `400` | `country is required.` | `country` is missing | | `400` | `Invalid City` | City not recognized, or `country` is missing. Send `country`, and add `state` if the error continues. | | `400` | `sdate is not a valid date.` | Bad `sdate` or `edate` | | `400` | `popular is not supported in v1.` | `popular` was removed. 0 credits. | | `400` | `page is beyond the 10000 result limit. Narrow the filters.` | `(page + 1) × reqRows` is over 10,000 | --- ## Events by Geo Coordinates Finds events around a point. Use it to show events near a user. ``` GET | POST /events/geo ``` ### Parameters | Parameter | Type | Required | Default | Description | |---|---|---|---|---| | `latitude` | number | **Yes** | | Latitude. Can't be `0`. | | `longitude` | number | **Yes** | | Longitude. Can't be `0`. | | `radius` | integer | **Yes** | | Radius in km, whole numbers only. Above 100 becomes 100. | | `category` | string | No | | One category, such as `music`. Matched as that category's keywords in the event name, description and tags. | | `shortDesc` | `1` | No | Off | Adds `description.short` | | `page` | integer | No | `0` | Page number, starting at 0. `(page + 1) × rows` can't exceed 1,000. | | `rows` | integer | No | `10` | Results per page. Maximum 10. | | `cached` | boolean | No | `true` | `false` fetches fresh data. See [Cached answers](#cached-answers). | ### Example request ```bash curl "$AE_BASE_URL/events/geo?latitude=51.5074&longitude=-0.1278&radius=10&rows=10" \ -H "X-API-Key: $AE_API_KEY" ``` ### Example response ```json { "message": "", "error": 0, "data": [ { "event_id": "80001234567894", "eventname": "Sunday Makers Market", "event_url": "https://allevents.in/london/sunday-makers-market/80001234567894?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "start_at": "2026-11-29T11:00:00+00:00", "end_at": "2026-11-29T16:00:00+00:00", "start_ts": 1795950000, "end_ts": 1795968000, "timezone": "+00:00", "label": "upcoming", "display": { "short": "Sun, 29 Nov • 11:00AM to 4:00PM", "full": "Sun, 29 Nov 2026 • 11:00 AM to 4:00 PM (GMT)" }, "schedule": { "has_multiple_dates": false, "next_date": null, "upcoming_dates": 1 }, "venue": { "name": "Example Square", "street": "Example Square, London WC2N 5DN", "city": "London", "state": "England", "country": "United Kingdom", "latitude": 51.508, "longitude": -0.128, "full_address": "Example Square, London WC2N 5DN, United Kingdom" }, "is_online": false, "organizer": { "org_id": 1000000003, "name": "Makers Collective", "url": "https://allevents.in/org/makers-collective/1000000003?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa" }, "categories": ["markets", "art"], "thumb_url": "https://example.com/images/sample-thumb.jpg", "banner_url": "https://example.com/images/sample-banner.jpg", "price": { "currency": null, "min": null, "max": null, "is_free": null, "label": null }, "tickets": { "has_tickets": false, "ticket_url": "https://allevents.in/pages/link?event_id=80001234567894&ref=ae_api&utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "provider": "Organizer" } } ], "count": 1, "credits_used": 1 } ``` Each item in `data` has the same fields as [the Event object](#response-fields), as in the list APIs. `description` is sent only with `shortDesc=1`. ### Errors | Status | `message` | Cause | |---|---|---| | `200` | `No events found` | Nothing found in the radius, or in your coverage | | `200` | `This location is not in your coverage.` | The point is outside your [coverage](#coverage). Answered at once, 0 credits. | | `400` | `latitude is required.` | A required parameter is missing. Also sent for `longitude` and `radius`. | | `400` | `latitude, longitude and radius are required.` | A coordinate is `0`, or the radius is below 1 | | `400` | `page is beyond the 1000 result limit. Narrow the filters.` | `(page + 1) × rows` is over 1,000 | --- ## Events Search Searches events worldwide by keyword. ``` GET | POST /events/search ``` ### Parameters | Parameter | Type | Required | Default | Description | |---|---|---|---|---| | `query` | string | **Yes** | | Search text | | `city` | string | No | | Puts events closest to this city first. **It orders results and does not limit them.** A city that isn't recognized answers `400 Invalid City`. A city outside your coverage answers `This city is not in your coverage.` (0 credits). | | `state` | string | No | | State code or name of `city` (`TX`, `Maharashtra`). Picks the right city when the name exists in several places (Delhi, India vs Delhi, NY). | | `country` | string | No | | Country name or code of `city` (`India`, `US`). With `country` the city is matched exactly as in [List Events by City (Advanced)](#list-events-by-city-advanced). | | `latitude` | number | No | | Orders results by distance from this point when `city` isn't sent. Send both coordinates; without a city or point, results rank by text only. | | `longitude` | number | No | | See `latitude` | | `page` | integer | No | `0` | Page number, starting at 0. `(page + 1) × rows` can't exceed 1,000. | | `rows` | integer | No | `10` | Results per page. Maximum 10. | | `cached` | boolean | No | `true` | `false` fetches fresh data. See [Cached answers](#cached-answers). | For one city only, use [List Events by City (Advanced)](#list-events-by-city-advanced) with `keyword`. ### Example request ```bash curl "$AE_BASE_URL/events/search" \ -H "X-API-Key: $AE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"query": "game", "city": "Berlin", "rows": 10}' ``` ### Example response ```json { "message": "", "error": 0, "data": [ { "event_id": "80001234567892", "eventname": "Indie Game Makers Meetup", "event_url": "https://allevents.in/berlin/indie-game-makers-meetup/80001234567892?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "start_at": "2026-12-03T19:00:00+01:00", "end_at": "2026-12-03T22:00:00+01:00", "start_ts": 1796320800, "end_ts": 1796331600, "timezone": "+01:00", "label": "upcoming", "display": { "short": "Thu, 3 Dec • 7:00PM to 10:00PM", "full": "Thu, 3 Dec 2026 • 7:00 PM to 10:00 PM (CET)" }, "schedule": { "has_multiple_dates": false, "next_date": null, "upcoming_dates": 1 }, "venue": { "name": "Pixel Loft", "street": "Beispielstraße 5, 10115 Berlin, Germany", "city": "Berlin", "state": "BE", "country": "Germany", "latitude": 52.531, "longitude": 13.3849, "full_address": "Pixel Loft, Beispielstraße 5, 10115 Berlin, Germany" }, "is_online": false, "organizer": null, "categories": ["gaming", "meetups"], "thumb_url": "https://example.com/images/sample-thumb.jpg", "banner_url": "https://example.com/images/sample-banner.jpg", "price": { "currency": null, "min": null, "max": null, "is_free": null, "label": null }, "tickets": { "has_tickets": false, "ticket_url": "https://allevents.in/pages/link?event_id=80001234567892&ref=ae_api&utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "provider": "Organizer" } } ], "credits_used": 1 } ``` ### Things to know Each item in `data` has the same fields as [the Event object](#response-fields), as in the list APIs (without `description`). - Items are ranked by text relevance, and every item is an event. - Without `state` and `country`, a city name used in several places resolves to the busiest one inside your coverage, so send both when you have them ([City Suggestions](#city-suggestions) returns them). - There is no `count`. Check `error` before you read `data`. ### Errors | Status | `message` | Cause | |---|---|---| | `200` | `No events found for query '…'` | Nothing matched | | `200` | `This city is not in your coverage.` | See [Coverage](#coverage) | | `400` | `Invalid City` | `city` isn't recognized. Check the spelling, or send `state` and `country`. 0 credits. | | `400` | `query is required.` | `query` is missing | | `400` | `page is beyond the 1000 result limit. Narrow the filters.` | `(page + 1) × rows` is over 1,000 | --- ## Event Details Returns one event with its full description, tickets and categories. Events that have ended aren't available: they answer `404`. ``` GET | POST /get_event ``` ### Parameters | Parameter | Type | Required | Description | |---|---|---|---| | `event_id` | digits | **Yes** | Event ID | | `cached` | boolean | No | Default `true`. `false` fetches fresh data. See [Cached answers](#cached-answers). | ### Example request ```bash curl "$AE_BASE_URL/get_event" \ -H "X-API-Key: $AE_API_KEY" \ -d "event_id=8000001234509" ``` ### Example response ```json { "error": 0, "message": "", "data": { "event_id": "8000001234509", "eventname": "Austin Food & Music Festival 2026", "event_url": "https://allevents.in/austin/austin-food-music-festival-2026/8000001234509?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "start_at": "2026-12-12T12:00:00-06:00", "end_at": "2026-12-12T22:00:00-06:00", "start_ts": 1797098400, "end_ts": 1797134400, "timezone": "-06:00", "label": "upcoming", "display": { "short": "Sat, 12 Dec • 12:00PM to 10:00PM", "full": "Sat, 12 Dec 2026 • 12:00 PM to 10:00 PM (CST)" }, "schedule": { "has_multiple_dates": false, "next_date": null, "upcoming_dates": 1, "dates": ["2026-12-12T12:00:00-06:00"] }, "venue": { "name": "Riverside Park Pavilion", "street": "100 Example Riverside Dr, Austin, TX 78704, United States", "city": "Austin", "state": "TX", "country": "United States", "latitude": 30.2622, "longitude": -97.747, "full_address": "Riverside Park Pavilion, 100 Example Riverside Dr, Austin, TX 78704, United States" }, "is_online": false, "organizer": { "org_id": 1000000001, "name": "Austin Live Events Co.", "url": "https://allevents.in/org/austin-live-events-co/1000000001?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa" }, "categories": ["food-drinks", "music", "festivals"], "thumb_url": "https://example.com/images/sample-thumb.jpg", "banner_url": "https://example.com/images/sample-banner.jpg", "video_url": null, "price": { "currency": "USD", "min": 35.0, "max": 45.0, "is_free": false, "label": "USD 35 to 45" }, "tickets": { "has_tickets": true, "ticket_url": "https://allevents.in/manage/tickets/book.php?hide_details=1&event_id=8000001234509&utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "provider": "AllEvents" }, "description": { "short": "A full day of local food trucks, live bands and craft stalls by the river 🎶", "text": "A full day of local food trucks, live bands and craft stalls by the river 🎶\nGates open at noon; free for kids under 12. Questions? Call 51255xxxxx.", "html": "

A full day of local food trucks, live bands and craft stalls by the river 🎶

Gates open at noon; free for kids under 12. Questions? Call 51255xxxxx.

" }, "updated_at": "2026-11-20T20:30:55Z" }, "credits_used": 1 } ``` ### Things to know `data` has the same fields as [the Event object](#response-fields), every one of them. - That includes the fields only Event Details and Events in Batch send: `video_url`, `schedule.dates`, `description.text`, `description.html` and `updated_at`, plus `description.short`. On an error, `data` is `false`. - `description.text` is plain text and `description.html` keeps the formatting. Both are partly masked (emails, phone numbers and links, such as `63511xxxxx`), and the HTML is sanitized: common formatting tags only, no scripts, event handlers or links to other sites. Links are kept only to AllEvents pages (others become plain text); images and videos are kept only with an `http(s)` source. AllEvents links in the text aren't masked; dates, times and prices aren't either. You can render the HTML as it is. - Answers are cached for 10 minutes, not 1 hour ([Cached answers](#cached-answers)). ### Errors | Status | `message` | Cause | |---|---|---| | `200` | `This event is out of your API Scope.` | See [Coverage](#coverage) | | `400` | `event_id is required.` | `event_id` is missing | | `400` | `Invalid event_id.` | `event_id` isn't a valid number | | `404` | `Event does not exist or is deleted` | Event not found | | `404` | `Event has ended or is not available` | The event has ended, or is hidden, a draft or archived. Costs 0 credits. | --- ## Events in Batch Returns all upcoming events in your coverage, a batch at a time. Use it to sync a local copy of the catalog. ``` GET | POST /events/batch ``` ### Parameters | Parameter | Type | Required | Default | Description | |---|---|---|---|---| | `next_cursor` | string | No | Start | The `next_cursor` from your last response, exactly as you got it | | `count` | integer | No | `1000` | Events per call, 1 to 1000. A larger value becomes 1000; `0`, a negative or a non-whole number answers `400`. | | `updated_after` | Unix timestamp | No | | Only events updated after this time (compare `updated_at`) | | `min_score` | number | No | | Only events with at least this internal ranking score. The score itself isn't returned. | | `cached` | boolean | No | `true` | `false` fetches fresh data. See [Cached answers](#cached-answers). | ### How to sync 1. Call without `next_cursor`. 2. Save the `next_cursor` from each response, and send it on the next call. 3. Stop when `message` is `END_OF_RESULTS` (`has_more` is then `false`). That answer's `next_cursor` is empty: keep the cursor you sent. 4. Later, call again with the **last cursor you saved** to pick up newly published events, and use `updated_after` for changes. `next_cursor` is an opaque string of about 50 characters (base64url). It changes on every response, even for the same position, so don't parse or compare it: store it and send it back untouched. Cursors from before 24 November 2026 (`c`) answer `400 next_cursor is not valid.`: start again without `next_cursor`. A call can return fewer events than `count`, or none, while the cursor moves on. If `result_count` is `0` and `message` isn't `END_OF_RESULTS`, continue with the new cursor. With narrow coverage, `message` can be `NO_COVERED_EVENTS_YET` (`error` is `0`): this stretch of the catalog had none of your events. It costs 0 credits; continue with `next_cursor`, which moves forward every time. ```python import os import requests url = f"{os.environ['AE_BASE_URL']}/events/batch" headers = {"X-API-Key": os.environ["AE_API_KEY"]} cursor = "" while True: response = requests.get(url, headers=headers, params={"next_cursor": cursor, "count": 1000}, timeout=45) response.raise_for_status() body = response.json() cursor = body["next_cursor"] or cursor # empty at END_OF_RESULTS: keep the last one for event in body["data"]: print(event["event_id"], event["eventname"]) # save the event here if body["message"] == "END_OF_RESULTS": break # save cursor to continue from here next time ``` ### Example response ```json { "error": 0, "message": "", "result_count": 1, "next_cursor": "CYmW5cMfBghFH8tVec3JRIIBXFHlzPYO3dtLYnpljvtyk46LfQ", "data": [ { "event_id": "80001234567893", "eventname": "Lantern Night Run", "event_url": "https://allevents.in/tokyo/lantern-night-run/80001234567893?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "start_at": "2026-12-05T18:00:00+09:00", "end_at": "2026-12-05T21:00:00+09:00", "start_ts": 1796461200, "end_ts": 1796472000, "timezone": "+09:00", "label": "upcoming", "display": { "short": "Sat, 5 Dec • 6:00PM to 9:00PM", "full": "Sat, 5 Dec 2026 • 6:00 PM to 9:00 PM (JST)" }, "schedule": { "has_multiple_dates": false, "next_date": null, "upcoming_dates": 1, "dates": ["2026-12-05T18:00:00+09:00"] }, "venue": { "name": "Riverside Park Track", "street": "1-2-3 Example-dori, Taito City", "city": "Tokyo", "state": "Tokyo", "country": "Japan", "latitude": 35.7148, "longitude": 139.7967, "full_address": "Riverside Park Track, 1-2-3 Example-dori, Taito City, Tokyo, Japan" }, "is_online": false, "organizer": { "org_id": 1000000004, "name": "Lantern Run Club", "url": "https://allevents.in/org/lantern-run-club/1000000004?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa" }, "categories": ["sports", "running", "outdoor"], "thumb_url": "https://example.com/images/sample-thumb.jpg", "banner_url": "https://example.com/images/sample-banner.jpg", "video_url": null, "price": { "currency": "JPY", "min": 2000.0, "max": 4500.0, "is_free": false, "label": "JPY 2000 to 4500" }, "tickets": { "has_tickets": true, "ticket_url": "https://allevents.in/manage/tickets/book.php?hide_details=1&event_id=80001234567893&utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "provider": "AllEvents" }, "description": { "short": "A 5 km evening run lit by paper lanterns.", "text": "A 5 km evening run lit by paper lanterns.\nAbout this Event", "html": "

A 5 km evening run lit by paper lanterns.

About this Event

" }, "updated_at": "2026-11-20T20:30:55Z" } ], "has_more": true, "credits_used": 1 } ``` Items have the same fields as [the Event object](#response-fields), all of them as in [Event Details](#event-details): with `video_url`, `schedule.dates`, `description` (`short`, `text`, `html`) and `updated_at`. Events come in the order they were added. `result_count` is the number of events in `data`, and `has_more` is `true` while more events follow the cursor (`false` at the end). Answers are cached for 10 minutes per `next_cursor` ([Cached answers](#cached-answers)). ### Errors | Status | `message` | Cause | |---|---|---| | `200` | `END_OF_RESULTS` | No more events for now. `error` is `1`, `data` is empty, `next_cursor` is `""` and `description` says to try again later. Retry later with the cursor you sent. | | `200` | `NO_COVERED_EVENTS_YET` | None of this stretch of the catalog is in your coverage. `data` is empty and it costs 0 credits. Continue with `next_cursor`. | | `400` | `count must be between 1 and 1000.` | `count` is `0`, negative or not a whole number. 0 credits. Leave it out for 1000. | | `400` | `next_cursor is not valid.` | The cursor isn't one this API returned, was changed, or is an old `c` cursor. Start again without `next_cursor`. | | `503` | `Something went wrong. Try again shortly.` | Temporary failure, 0 credits. Retry with the same cursor. | --- ## Events by Organizer Lists one organizer's upcoming and running events. Get `organizer_id` from the `org_id` of [Search Organizers](#search-organizers) or of an event's `organizer`. ``` GET | POST /organizer/events ``` ### Parameters | Parameter | Type | Required | Default | Description | |---|---|---|---|---| | `organizer_id` | digits | **Yes** | | Organizer ID | | `city` | string | No | | Only events in this city | | `past` | integer | No | `0` | Only `0` is accepted; any other value answers `400`. | | `page` | integer | No | `0` | Page number, starting at 0 | | `count` | integer | No | `10` | Results per page. Maximum 10. | | `cached` | boolean | No | `true` | `false` fetches fresh data. See [Cached answers](#cached-answers). | ### Example request ```bash curl "$AE_BASE_URL/organizer/events?organizer_id=1000000001&count=10" \ -H "X-API-Key: $AE_API_KEY" ``` ### Example response ```json { "message": "Done", "error": 0, "data": [ { "event_id": "80001234567895", "eventname": "Comedy Night at the Riverside", "event_url": "https://allevents.in/austin/comedy-night-at-the-riverside/80001234567895?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "start_at": "2026-12-10T20:00:00-06:00", "end_at": "2026-12-10T22:00:00-06:00", "start_ts": 1796954400, "end_ts": 1796961600, "timezone": "-06:00", "label": "upcoming", "display": { "short": "Thu, 10 Dec • 8:00PM to 10:00PM", "full": "Thu, 10 Dec 2026 • 8:00 PM to 10:00 PM (CST)" }, "schedule": { "has_multiple_dates": false, "next_date": null, "upcoming_dates": 1 }, "venue": { "name": "Riverside Park Pavilion", "street": "100 Example Riverside Dr", "city": "Austin", "state": "TX", "country": "United States", "latitude": 30.2622, "longitude": -97.747, "full_address": "Riverside Park Pavilion, 100 Example Riverside Dr, Austin, United States" }, "is_online": false, "organizer": { "org_id": 1000000001, "name": "Austin Live Events Co.", "url": "https://allevents.in/org/austin-live-events-co/1000000001?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa" }, "categories": ["comedy", "nightlife"], "thumb_url": "https://example.com/images/sample-thumb.jpg", "banner_url": "https://example.com/images/sample-banner.jpg", "price": { "currency": "USD", "min": 15.0, "max": 20.0, "is_free": false, "label": "USD 15 to 20" }, "tickets": { "has_tickets": true, "ticket_url": "https://allevents.in/manage/tickets/book.php?hide_details=1&event_id=80001234567895&utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "provider": "AllEvents" } } ], "count": 1, "credits_used": 1 } ``` Each item in `data` has the same fields as [the Event object](#response-fields), as in the list APIs. `organizer` is the organizer you requested. ### Errors | Status | `message` | Cause | |---|---|---| | `200` | `No events found.` | The organizer has no matching events | | `200` | `This city is not in your coverage.` | See [Coverage](#coverage) | | `400` | `organizer_id is required.` | `organizer_id` is missing | | `400` | `Parameter missing.` | `organizer_id` isn't a number | | `400` | `Past events are not available.` | `past` isn't `0` | | `404` | `Organizer not found.` | No organizer has this ID, or its events aren't available through the API | --- ## Search Organizers Finds event organizers by name. Results aren't limited by your coverage. Some organizers, such as listings imported from other sites, are never returned. ``` GET | POST /organizers/search ``` ### Parameters | Parameter | Type | Required | Default | Description | |---|---|---|---|---| | `term` | string | **Yes** | | Start of the organizer's name | | `page` | integer | No | `0` | Page number, starting at 0. Each page has up to 10 results, and `(page + 1) × 10` can't exceed 1,000. | | `cached` | boolean | No | `true` | `false` fetches fresh data. See [Cached answers](#cached-answers). | ### Example request ```bash curl "$AE_BASE_URL/organizers/search?term=austin" \ -H "X-API-Key: $AE_API_KEY" ``` ### Example response ```json { "message": "", "error": 0, "data": [ { "org_id": 1000000001, "name": "Austin Live Events Co.", "url": "https://allevents.in/org/austin-live-events-co/1000000001?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa", "thumb_url": "https://example.com/images/sample-organizer.jpg", "about": "Food, music and street festivals across Austin.", "upcoming_events": 3, "followers_count": 1280 } ], "credits_used": 1 } ``` ### Response fields | Field | Type | Description | |---|---|---| | `org_id` | integer | Organizer ID. Send it as `organizer_id` to [Events by Organizer](#events-by-organizer). | | `name` | string | Organizer name | | `url` | string | Organizer's AllEvents page, with your UTM code | | `thumb_url` | string or null | Profile image URL | | `about` | string or null | Organizer description, plain text, masked like event descriptions | | `upcoming_events` | integer | Number of upcoming events | | `followers_count` | integer | Number of followers | ### Errors | Status | Result | Cause | |---|---|---| | `200` | `error: 0` and an empty `data` list | No organizer matched. Costs 0 credits. | | `400` | `term is required.` | `term` is missing | --- ## City Suggestions Suggests up to 10 cities in your coverage from a partial name. Use it for autocomplete, or to get the exact `state` and `country` for the list APIs. ``` GET | POST /geo/city_suggestion?city={text} GET | POST /geo/city_suggestion/{text} ``` ### Parameters | Parameter | Type | Required | Description | |---|---|---|---| | `city` | string | **Yes** | Full or partial city name. Use the query form for text with `+` or `%`. | | `cached` | boolean | No | Default `true`. `false` fetches fresh data. See [Cached answers](#cached-answers). | ### Example request ```bash curl "$AE_BASE_URL/geo/city_suggestion?city=Lond" \ -H "X-API-Key: $AE_API_KEY" ``` ### Example response ```json { "data": [ { "city": "London", "state": "ENG", "state_name": "England", "country": "United Kingdom", "country_code": "GB", "latitude": 51.507351, "longitude": -0.127758, "timezone": "+00:00", "url": "https://allevents.in/london?utm_source=ae_api&utm_medium=api&utm_campaign=k7f2qa" } ], "credits_used": 1 } ``` ### Response fields | Field | Type | Description | |---|---|---| | `city` | string | City name. Send it as `city`. | | `state`, `state_name` | string or null | State or region code and name. Send `state` as `state`. | | `country` | string | Country name. Send it as `country`. | | `country_code` | string or null | 2-letter country code | | `latitude`, `longitude` | number | Center of the city | | `timezone` | string or null | City's UTC offset, `±HH:MM` | | `url` | string | City's AllEvents page, with your UTM code | ### Errors | Status | Result | Cause | |---|---|---| | `200` | `{"data": [], "credits_used": 0}` | No city matched, or none in your coverage. This response has no `error` field. | | `400` | `city is required.` | `city` is missing | --- ## Ticket links `tickets.ticket_url` is where to buy or find tickets. It may redirect through allevents.in, and ends with your UTM code. Show it as it is; don't build it from the event ID, as its form can change. `tickets.provider` names who sells the tickets. | The event | `ticket_url` | `provider` | |---|---|---| | Sells tickets on AllEvents | The AllEvents booking page, `https://allevents.in/manage/tickets/book.php?…&event_id=&utm_…` | `AllEvents` | | Sells tickets on another site, or on the organizer's | `https://allevents.in/pages/link?event_id=&ref=ae_api&utm_…`, which forwards the buyer to that site | The seller, such as `Eventbrite`, `Ticketmaster`, `BookMyShow` or `Skiddle`, or `Organizer` for the organizer's own link | | Neither | The event page, the same as `event_url` | `null` | `tickets.has_tickets` is `true` only for tickets sold through AllEvents. Prices are in `price`, not in `tickets`. --- ## Field types by API Since 24 November 2026 every event API returns the same [Event object](#response-fields), with the same types everywhere. A few fields are sent only by [Event Details](#event-details) and [Events in Batch](#events-in-batch): | Field | List APIs, `/events/geo`, `/events/search`, `/organizer/events` | `/get_event`, `/events/batch` | |---|---|---| | `event_id` | string | string | | `organizer.org_id` | integer | integer | | `start_ts`, `end_ts` | integer | integer | | `venue.latitude`, `venue.longitude` | number or null | number or null | | `categories` | array of strings | array of strings | | `price.min`, `price.max` | number or null | number or null | | `schedule.dates` | not returned | array of ISO 8601 strings | | `video_url` | not returned | string or null | | `description` | only `short`, with `shortDesc=1` (list APIs and geo) | `short`, `text`, `html` | | `updated_at` | not returned | string, ISO 8601 UTC | Store `event_id` as a string. Ignore fields you don't know: new ones may be added. --- ## Migrating from the Azure API | | Azure API | This API | |---|---|---| | **API key header** | `Ocp-Apim-Subscription-Key` | `X-API-Key` | | **Key in query string** | `subscription-key` allowed | Not allowed | | **API keys** | Azure subscription keys | New keys from the developer portal | Paths are unchanged under the new base URL. Response bodies follow the schema of 24 November 2026 (see [Recent changes](#recent-changes)), so map the fields removed in 2026-11-24 to their replacements, for example: - `eventname_raw` is `eventname`, `location` is `venue.name`, and `start_time`/`end_time` are `start_at`/`end_at` (venue time) or `start_ts`/`end_ts` (real UTC). - Ticket prices are in `price`; `short_description` and `description_html` are in `description`. - **Events in Batch:** old cursors don't work. Start a new sync without `next_cursor`. - **City Suggestions:** results are inside `data`, instead of a bare array, and `region_code` is `state`. - **All APIs:** each call's cost is in `credits_used` and the `X-Credits-Used` header. --- # Guides Source: https://developer.allevents.in/docs/guides/city-events-page ## Build a city events page A page that lists what's on in one city this month, rendered on your server. It uses two APIs: [City Suggestions](/docs/geo-city-suggestion) to find the exact city, and [List Events by City (Advanced)](/docs/events-list-es) to list its events. You need an API key and Node.js 18 or later. The code runs only on your server: the key never reaches the browser. ### 1. Set up the key Keep the key in environment variables, never in code: ```bash export AE_API_KEY="ae_api_your_key" export AE_BASE_URL="https://developer.allevents.in/v1" ``` Every call goes through one small helper. It sends the key in the `X-API-Key` header, sets a timeout, and turns a `429` into an error that says how long to wait. ```javascript // allevents.js (server-side only) const BASE = process.env.AE_BASE_URL; const KEY = process.env.AE_API_KEY; export async function aeGet(path, params) { const response = await fetch(`${BASE}${path}?${new URLSearchParams(params)}`, { headers: { "X-API-Key": KEY }, signal: AbortSignal.timeout(45_000), }); if (response.status === 429) { const wait = Number(response.headers.get("retry-after") ?? 60); throw new Error(`Rate limited: retry in ${wait} s`); } return { status: response.status, body: await response.json() }; } ``` ### 2. Find the exact city City names are ambiguous: there is more than one Austin. Look the city up once and keep the `city`, `state` and `country` it returns. ```bash curl "$AE_BASE_URL/geo/city_suggestion?city=Austin" \ -H "X-API-Key: $AE_API_KEY" ``` ```javascript // events.js import { aeGet } from "./allevents.js"; export async function findCity(name) { const { body } = await aeGet("/geo/city_suggestion", { city: name }); const match = body.data?.[0]; if (!match) return null; return { city: match.city, state: match.state, country: match.country }; } ``` Store the result with your page (for example `{ city: "Austin", state: "TX", country: "United States" }`) so you don't look it up on every visit. ### 3. List the city's events Ask for this month's events, soonest first, one page at a time. `page` starts at 0. ```javascript // events.js (continued) export async function cityEvents(place, page = 0) { const { status, body } = await aeGet("/events/list_es", { ...place, when: "this_month", sort: "date", reqRows: "10", page: String(page), }); // Always check `error` as well as the status: 200 with error > 0 means "nothing usable". if (status !== 200 || body.error > 0) return []; return body.data; } ``` - At most 10 events come back per call (`reqRows` up to 10). A page can be shorter than `reqRows` even when more events exist (for example with limited coverage). Offer a "More events" link until a page comes back empty. - Repeating the same call within an hour is answered from the cache and costs 0 credits (`credits_used: 0`), so don't add `cached=false` to a page like this. ### 4. Render the page `display.short` is ready-made date and time text in the venue's time: show it as is. (`start_at` is the same moment in ISO 8601 with the venue's offset, and `start_ts` in Unix seconds, if you format or sort yourself; see [Dates and times](/docs#dates-and-times).) Text fields are plain text, so escape every one before you put it in HTML. ```javascript // server.js import { createServer } from "node:http"; import { cityEvents } from "./events.js"; const AUSTIN = { city: "Austin", state: "TX", country: "United States" }; const esc = (s) => String(s ?? "").replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`); createServer(async (req, res) => { const page = Number(new URL(req.url, "http://localhost").searchParams.get("page") ?? 0); const events = await cityEvents(AUSTIN, page); const items = events .map((e) => `
  • ${esc(e.eventname)} · ${esc(e.display.short)} · ${esc(e.venue.name)}
  • `) .join(""); res.writeHead(200, { "content-type": "text/html; charset=utf-8" }); res.end(`

    Events in Austin this month

      ${items || "
    • No events found.
    • "}
    ${events.length ? `More events` : ""}

    Data from AllEvents

    `); }).listen(3000); ``` Where you show the data publicly, keep the "Data from AllEvents" line with its link (see the API Terms of Use in the developer portal). ### Next steps - Add filters such as `category=music` or `price=free`: see [How filters combine](/docs/events-list-es#how-filters-combine). - Link each event to `event_url`, its AllEvents page with tickets and details. - Handle the [error codes](/docs/errors) you can get, such as `credits_exhausted`. --- Source: https://developer.allevents.in/docs/guides/batch-sync ## Keep a local copy in sync with the batch feed [Events in Batch](/docs/events-batch) returns every upcoming event in your coverage, up to 1,000 per call, with a cursor that remembers where you stopped. This guide keeps a local copy of those events up to date with a script you run on a schedule. You need an API key and Node.js 18 or later. The script runs on your server or as a scheduled job, never in a browser. ### How the feed works 1. The first call has no `next_cursor`. 2. Each response has a `next_cursor`: send it on the next call. 3. When `message` is `END_OF_RESULTS` (`has_more` is `false`), you have everything for now. That answer's `next_cursor` is empty: keep the cursor you sent. 4. Next time, start from the saved cursor to get events published since. `next_cursor` is an opaque string that changes on every response: store it and send it back untouched. A call can return fewer events than `count`, or none, while the cursor still moves on (with narrow coverage, `message` can be `NO_COVERED_EVENTS_YET`). Keep going until `END_OF_RESULTS`. Calls that return events use credits (your cost per call is in the portal, and each answer's `credits_used` says what it cost); `END_OF_RESULTS` and `NO_COVERED_EVENTS_YET` answers cost 0. ### The sync script The script keeps its cursor and events in a JSON file so it runs as is. In production, write them to your database instead. ```javascript // sync.js: run it every hour or so, for example from cron. import { readFile, writeFile } from "node:fs/promises"; const BASE = process.env.AE_BASE_URL; // https://developer.allevents.in/v1 const KEY = process.env.AE_API_KEY; const STORE = "./ae-events.json"; const sleep = (s) => new Promise((r) => setTimeout(r, s * 1000)); async function load() { try { return JSON.parse(await readFile(STORE, "utf8")); } catch { return { cursor: "", events: {} }; } } /** One batch call, with retries on 429 (rate limit) and 503 (temporary failure). */ async function fetchBatch(cursor) { for (let attempt = 1; ; attempt++) { const params = new URLSearchParams({ count: "1000" }); if (cursor) params.set("next_cursor", cursor); const response = await fetch(`${BASE}/events/batch?${params}`, { headers: { "X-API-Key": KEY }, signal: AbortSignal.timeout(45_000), }); if ((response.status === 429 || response.status === 503) && attempt < 5) { await sleep(Number(response.headers.get("retry-after")) || 5 * attempt); continue; } const body = await response.json(); if (response.status === 400 && cursor) return { invalidCursor: true }; if (!response.ok) throw new Error(`events/batch ${response.status}: ${body.message}`); return body; } } export async function sync() { const store = await load(); let cursor = store.cursor; for (;;) { const body = await fetchBatch(cursor); if (body.invalidCursor) { cursor = ""; // the cursor is no longer valid (or an old c one): start a full sync again continue; } for (const event of body.data ?? []) { store.events[event.event_id] = { name: event.eventname, start_at: event.start_at, // venue time, ISO 8601 with offset: show as written end_ts: event.end_ts, // real UTC, Unix seconds when: event.display.short, city: event.venue.city, url: event.event_url, synced_at: Date.now(), }; } if (body.next_cursor) cursor = body.next_cursor; // empty at END_OF_RESULTS: keep the last one if (body.message === "END_OF_RESULTS") break; } // Drop events that have ended: end_ts is real UTC. const now = Date.now() / 1000; for (const [id, e] of Object.entries(store.events)) { if (e.end_ts < now) delete store.events[id]; } store.cursor = cursor; await writeFile(STORE, JSON.stringify(store)); console.log(`Synced: ${Object.keys(store.events).length} events`); } await sync(); ``` Run it with `node sync.js`. The first run pages through everything in your coverage; later runs only fetch what's new. ### Refresh what changed New events arrive through the cursor. To pick up changes to events you already have, send `updated_after` (a Unix timestamp; compare each event's `updated_at`) with a fresh sync from an empty cursor, for example once a day: ```bash curl "$AE_BASE_URL/events/batch?updated_after=1795000000&count=1000" \ -H "X-API-Key: $AE_API_KEY" ``` Before you show one event's details, you can re-read it with [Event Details](/docs/get-event). Add `cached=false` only if your copy must be the latest; a cached answer costs 0 credits (`credits_used: 0`). ### Keep the copy honest - Delete events once they have ended: the API never returns them again. Refresh or delete data that is out of date (see the API Terms of Use in the developer portal). - Store `event_id` as a string: it's a string on every API, and can be longer than JavaScript's safe integers. - Every API returns the same Event fields; Events in Batch also sends `description`, `schedule.dates`, `video_url` and `updated_at`. See [Field types by API](/docs#field-types-by-api). - If you show the events publicly, credit "Data from AllEvents" with a link to allevents.in. --- Source: https://developer.allevents.in/docs/guides/events-near-user ## Show events near a user Show a user what's happening around them. The browser asks for the user's location and sends it to your server; your server calls [Events by Geo Coordinates](/docs/events-geo) with your key and returns the events. You need an API key and a server that can run JavaScript (Node.js 18 or later). The key stays on the server: the browser only talks to your own route. ### 1. Try the API `latitude`, `longitude` and `radius` (whole kilometres, up to 100) are required. Coordinates can't be `0`. ```bash curl "$AE_BASE_URL/events/geo?latitude=30.2672&longitude=-97.7431&radius=10&rows=10" \ -H "X-API-Key: $AE_API_KEY" ``` ### 2. Add a server route This handler uses the standard `Request` and `Response` objects, so it works as a Next.js route handler (`app/api/nearby/route.js`) and in most other JavaScript servers. ```javascript // app/api/nearby/route.js (server-side only) const BASE = process.env.AE_BASE_URL; // https://developer.allevents.in/v1 const KEY = process.env.AE_API_KEY; // Rounding to 2 decimals (about 1 km) makes nearby users send the same call, // which is then answered from the cache at 0 credits. const round = (v) => Math.round(Number(v) * 100) / 100; export async function GET(request) { const url = new URL(request.url); const lat = round(url.searchParams.get("lat")); const lng = round(url.searchParams.get("lng")); if (!Number.isFinite(lat) || !Number.isFinite(lng) || Math.abs(lat) > 90 || Math.abs(lng) > 180 || (lat === 0 && lng === 0)) { return Response.json({ error: "Send lat and lng" }, { status: 400 }); } const params = new URLSearchParams({ latitude: String(lat), longitude: String(lng), radius: "10", rows: "10" }); const response = await fetch(`${BASE}/events/geo?${params}`, { headers: { "X-API-Key": KEY }, signal: AbortSignal.timeout(45_000), }); if (response.status === 429) { return Response.json({ error: "Busy, try again soon" }, { status: 503, headers: { "retry-after": response.headers.get("retry-after") ?? "60" } }); } const body = await response.json(); // 200 with error > 0 means nothing was found nearby, or the point is outside your coverage (0 credits). const events = response.ok && body.error === 0 ? body.data : []; return Response.json( events.map((e) => ({ id: e.event_id, name: e.eventname, when: e.display.short, starts: e.start_at, venue: e.venue.name, url: e.event_url })), { headers: { "cache-control": "private, max-age=300" } }, ); } ``` Only the fields your page needs go back to the browser, never the key or the raw API response headers. ### 3. Call it from the browser ```javascript // In your page's script. No API key here: it calls your own route. const list = document.querySelector("#nearby"); navigator.geolocation.getCurrentPosition( async ({ coords }) => { const response = await fetch(`/api/nearby?lat=${coords.latitude}&lng=${coords.longitude}`); const events = response.ok ? await response.json() : []; list.replaceChildren( ...events.map((e) => { const item = document.createElement("li"); const link = Object.assign(document.createElement("a"), { href: e.url, textContent: e.name }); item.append(link, ` · ${e.when} · ${e.venue ?? ""}`); return item; }), ); if (events.length === 0) list.textContent = "No events found nearby."; }, () => (list.textContent = "Allow location access to see events near you, or search by city."), ); ``` `when` is `display.short`, ready-made text in the venue's time, so it's shown as is. `starts` (`start_at`) is ISO 8601 with the venue's offset, for sorting or your own formatting; `venue.name` can be `null` (see [Dates and times](/docs#dates-and-times)). ### Things to know - Ask for the location only after the user does something, such as pressing "Events near me". If they say no, fall back to a city search with [City Suggestions](/docs/geo-city-suggestion). - With limited coverage, results outside it are left out and a page can be short or empty; a point outside your coverage answers `error: 1` (`This location is not in your coverage.`) at once. See [Coverage](/docs#coverage). - At most 10 events come back per call (`rows` up to 10); use `page` for more. - Show "Data from AllEvents" with a link to allevents.in wherever the events are public (see the API Terms of Use in the developer portal). --- # Other pages - [Errors and error codes](https://developer.allevents.in/docs/errors): Every HTTP status and error code the AllEvents API returns, what each one means and how to fix it. - [Event widgets for your website](https://developer.allevents.in/docs/widgets): Embed a live list of upcoming events on any website with two lines of HTML. Pick a city, organizer or keyword and your look. No API key in the page. - [API status](https://developer.allevents.in/status): Live status of the AllEvents API gateway, event data, developer portal and docs. - [Support](https://developer.allevents.in/support): How to get help with the AllEvents API: docs, troubleshooting, error codes, status, and what to include when you contact support.