302 redirect to a short-lived pre-signed URL pointing directly to the underlying file in cloud storage — your HTTP client will follow this redirect automatically. When you apply filters, select columns, or request a non-CSV format, the server queries and transforms the data on the fly before returning it.
Authentication
Authenticate using HTTP Basic Auth with your API key as the username. You can alternatively pass the key as theapiKey query parameter. You must have at least Read permission on the dataset.
Request
Method:GETURL:
https://api.alphacast.io/datasets/{dataset_id}/data
Path parameters
integer
required
The numeric ID of the dataset to download.
Query parameters
string
Your Alphacast API key. Use this as an alternative to HTTP Basic Auth, for example when constructing download links for use in a browser or spreadsheet application.
string
default:"csv"
Output format for the downloaded data. Accepted values:
csv, json, xlsx, tsv.When the format is csv and no other filters are applied, the API returns a 302 redirect to a pre-signed URL instead of streaming the file directly.string
A comma-separated list of column names or column IDs to include in the output. Entity/dimension columns (such as
Date and Country) are always prepended automatically so the result remains well-formed.Example: $select=Date,GDP or $select=1,3 (using column IDs).string
An OData filter expression to restrict the rows returned. Column names are case-sensitive and must match the column names in the dataset schema exactly.Supported comparison operators:
Supported logical operators:
eq, ne, gt, lt, ge, le.Supported logical operators:
and, or.Example: $filter=Country eq 'USA' and Date ge '2020-01-01'integer
Limit the response to the first N rows. When combined with
$filter, the limit is applied after filtering. When $top is set, the response includes a Row-Count header with the total number of rows matching any applied filter (before the limit), so you can implement pagination.integer
Return only the rows corresponding to the last N date periods in the dataset. For example,
$last=100 returns approximately the most recent 100 rows ordered by the date column. When $last is set, the response includes a Row-Count header with the total row count of the dataset.boolean
When
true, entity/dimension columns are merged into a single combined column in the output. Useful for pivot-style formats.boolean
When
true, column IDs are included in the output header row alongside column names.boolean
When
true and combined with $select, rows where all selected value columns are null or empty are omitted from the output.boolean
When
true, the output matrix is transposed: dates become column headers and columns become row labels. When no other filters are active and the format is CSV, a pre-signed URL to a pre-transposed file is returned instead.string
A specific version ID to download. Use this to retrieve a historical snapshot of the dataset’s data as it existed at a previous point in time.
Response
When no filters are applied and the format iscsv, the API responds with 302 Found and a Location header containing a short-lived pre-signed download URL. Your HTTP client will follow this redirect automatically.
When filters are applied or a non-CSV format is requested, the API streams the response directly with the appropriate Content-Type.
Row-Count response header
When you use$top or $last, the response includes a Row-Count header with the total untruncated row count:
OData filter syntax
The$filter parameter accepts OData filter expressions. Column names must exactly match the column names shown in the dataset schema (use GET /datasets/{id} to retrieve the schema).
String values must be enclosed in single quotes. Date values must use
YYYY-MM-DD format.
Filtering is validated against the dataset’s column schema. If you reference a column name that does not exist in the dataset, the API returns
400 Bad Request listing the invalid column names.