
## Regions

The base URL depends on your project's data residency. In all examples on this page, use the default base URL unless your project uses Amplitude's EU data center—in that case use the EU base URL in this table.

Requests go to `https://amplitude.com` (default) or `https://analytics.eu.amplitude.com` (EU). The `https://analytics.amplitude.com` hostname is the Analytics web app (browser UI); use the hosts in this table for REST requests, not `analytics.amplitude.com`.

| Data residency | Base URL                             |
| -------------- | ------------------------------------ |
| Default        | `https://amplitude.com`              |
| EU             | `https://analytics.eu.amplitude.com` |

## Considerations

- The date range refers to the time the event data was uploaded to Amplitude servers (refer to `server_upload_time`). The Export API returns events timestamped in UTC. Data is available to export within 2 hours of when the servers received it. For example, data sent between 8 and 9 PM begins loading at 9 PM and is available through the Export API at 11 PM. Platform reporting has no delay. Only exports are delayed.
- The Export API doesn't support cross-project views, because the view doesn't own any data. To export all the data in the view, call the Export API on the underlying projects that ingested the data.
- The size limit is 4GB. If the size exceeds 4GB, the request returns a 400 response. In this case, choose a smaller time range to export the data. If an hour's worth of data exceeds 4GB, use the [Amazon S3 export](/docs/data/destination-catalog/amazon-s3#run-a-manual-export).
- To export a whole day, use `T00` to `T23`. For example, `GET 'https://amplitude.com/api/2/export?start=20220101T00&end=20220101T23'`
- The maximum period you can query at once is 365 days.

## Request

`GET https://amplitude.com/api/2/export`

{% code-group %}
```curl cURL
curl --location --request GET 'https://amplitude.com/api/2/export?start=<starttime>&end=<endtime>' \
-u '{api_key}:{secret_key}'
```

```bash HTTP
GET /api/2/export?start=<starttime>&end=<endtime> HTTP/1.1
Host: amplitude.com
Authorization: Basic {api-key}:{secret-key} #credentials must be base64 encoded
```
{% /code-group %}

{% accordion title="Example: Get data for a period" %}
Export activity data between midnight on January 1, 2022 and midnight January 27, 2022.

{% code-group %}
```curl cURL
curl --location --request GET 'https://amplitude.com/api/2/export?start=20220101T00&end=20220127T00' \
--header 'Authorization: Basic YWhhbWwsdG9uQGFwaWdlZS5jb206bClwYXNzdzByZAo'
```

```bash HTTP
GET /api/2/export?start=20220101T00&end=20220127T00 HTTP/1.1
Host: amplitude.com
Authorization: Basic YWhhbWwsdG9uQGFwaWdlZS5jb206bClwYXNzdzByZAo
```
{% /code-group %}
{% /accordion %}

## Query parameters

| Name    | Required | Description                                                                              |
| ------- | -------- | ---------------------------------------------------------------------------------------- |
| `start` | Yes      | First hour included in data series, formatted `YYYYMMDDTHH`. For example, `20220201T05`. |
| `end`   | Yes      | Last hour included in data series, formatted `YYYYMMDDTHH`. For example, `20220201T05`.  |

## Response

The response is a zipped archive of JSON files. Depending on data volume, there can be several files per hour. The API returns a 404 response if there is no data for the time range you requested.

{% callout type="note" heading="" %}
Events before November 12, 2014 are grouped by day, instead of by the hour.
{% /callout %}

### Response schema

The response includes one event JSON object per line in each file, with the following schema:

```json
{
 "server_received_time": UTC ISO-8601 formatted timestamp,
 "app": int,
 "device_carrier": string,
 "city": string,
 "user_id": string,
 "uuid": UUID,
 "event_time": UTC ISO-8601 formatted timestamp,
 "platform": string,
 "os_version": string,
 "amplitude_id": long,
 "processed_time": UTC ISO-8601 formatted timestamp,
 "version_name": string,
 "ip_address": string,
 "paying": boolean,
 "dma": string,
 "group_properties": dict,
 "user_properties": dict,
 "client_upload_time": UTC ISO-8601 formatted timestamp,
 "$insert_id": string,
 "event_type": string,
 "library": string,
 "amplitude_attribution_ids": string,
 "device_type": string,
 "start_version": string,
 "location_lng": float,
 "server_upload_time": UTC ISO-8601 formatted timestamp,
 "event_id": int,
 "location_lat": float,
 "os_name": string,
 "groups": dict,
 "event_properties": dict,
 "data": dict,
 "device_id": string,
 "language": string,
 "country": string,
 "region": string,
 "session_id": long,
 "device_family": string,
 "sample_rate": null,
 "client_event_time": UTC ISO-8601 formatted timestamp,
}
```

## Status codes

| Code | Message                                                                                                                                                                  |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 200  | Success                                                                                                                                                                  |
| 400  | The file size of the exported data is too large. Shorten the time ranges and try again. The limit size is 4GB.                                                           |
| 404  | No data available for the time range requested.                                                                                                                          |
| 504  | The amount of data is large causing a timeout. For large amounts of data, use the [Amazon S3 destination](/docs/data/destination-catalog/amazon-s3#run-a-manual-export). |
