Welcome to the new home of the HDX FAQ
For the complete documentation index, see llms.txt. This page is also available as Markdown.

OpenAPI specification

Full parameter and response reference for the three Tabular Data Endpoints.

Query these endpoints with curl or an API client, using your HDX token:

curl -H "Authorization: <your-api-token>" \  "https://data.humdata.org/api/3/action/datastore_search?resource_id=<resource-id>&limit=5"

For a GUI, import the OpenAPI spec into Postman, Insomnia, Bruno, or Scalar and set an Authorization header. Get your token at data.humdata.org → profile → Manage API tokens.

Get DataStore resource metadata

get

Retrieve field definitions, type information, and size/count metadata for a DataStore resource.

Authorizations
AuthorizationstringRequired

HDX API token. Required for all Tabular Data Endpoint requests, including public resources.

Query parameters
resource_idstringRequired

The id or alias of the DataStore resource to describe. Required.

Responses
200

Successful response.

application/json
helpstringRequired

URL to the API documentation for this action.

successbooleanRequired

Whether the request succeeded.

get/datastore_info

Get DataStore resource metadata (POST)

post

Identical to the GET form.

Authorizations
AuthorizationstringRequired

HDX API token. Required for all Tabular Data Endpoint requests, including public resources.

Body
resource_idstringRequired

The id or alias of the DataStore resource to describe. Required.

Responses
200

Successful response.

application/json
helpstringRequired

URL to the API documentation for this action.

successbooleanRequired

Whether the request succeeded.

post/datastore_info
get

Query rows from a DataStore resource with optional filtering, full-text search, sorting, and pagination.

Pass parameters as query string arguments (GET) or as a JSON body (POST).

Authorizations
AuthorizationstringRequired

HDX API token. Required for all Tabular Data Endpoint requests, including public resources.

Query parameters
resource_idstringRequired

The id or alias of the resource to search. Required.

qany of · nullableOptional

Full-text search query. Pass a string to search across all fields, or a dictionary of {field: query} to target specific fields. Note: behavior differs subtly from filtersq uses full-text ranking while filters performs exact matching.

Default: null
stringOptional
or
full_textstring · nullableOptional

Full-text search query applied across all fields. Similar to q with a string value, but always searches all fields. Cannot be combined with q.

Default: null
distinctboolean · nullableOptional

Return only unique rows. Defaults to false.

Default: false
plainboolean · nullableOptional

Treat the q query as plain text (no special FTS operators). Set to false to use PostgreSQL tsquery syntax. Defaults to true.

Default: true
languagestring · nullableOptional

Language used for full-text search stemming. Defaults to english.

Default: english
limitinteger · nullableOptional

Maximum number of rows to return. Defaults to 100.

Default: 100
offsetinteger · nullableOptional

Number of rows to skip before returning results. Used for pagination.

Default: null
fieldsany of · nullableOptional

Columns to include in the response. Pass a comma-separated string or a list. Defaults to all fields.

Default: null
string[]Optional
or
stringOptional
sortstring · nullableOptional

Comma-separated list of fields to sort by, with optional asc/desc direction. Example: "fieldname1 asc, fieldname2 desc".

Default: null
include_totalboolean · nullableOptional

Include the total number of matching rows in the response. Defaults to true.

Default: true
total_estimation_thresholdinteger · nullableOptional

When include_total is true and the estimated row count exceeds this threshold, CKAN returns an estimated total rather than an exact count. Set to null (default) to always return an exact count.

Default: null
records_formatstring · enum · nullableOptional

Format for the returned records. objects returns a list of dicts, lists returns a list of lists, csv and tsv return delimited strings. Defaults to objects.

Default: objectsPossible values:
Responses
200

Successful response.

application/json
helpstringRequired

URL to the API documentation for this action.

successbooleanRequired

Whether the request succeeded.

get/datastore_search

Search a DataStore resource (POST)

post

Identical to the GET form. Use POST to pass parameters as a JSON body, which is useful for large filters or fields payloads.

Authorizations
AuthorizationstringRequired

HDX API token. Required for all Tabular Data Endpoint requests, including public resources.

Body
resource_idstringRequired

The id or alias of the resource to search. Required.

qany of · nullableOptional

Full-text search query. Pass a string to search across all fields, or a dictionary of {field: query} to target specific fields. Note: behavior differs subtly from filtersq uses full-text ranking while filters performs exact matching.

Default: null
stringOptional
or
full_textstring · nullableOptional

Full-text search query applied across all fields. Similar to q with a string value, but always searches all fields. Cannot be combined with q.

Default: null
distinctboolean · nullableOptional

Return only unique rows. Defaults to false.

Default: false
plainboolean · nullableOptional

Treat the q query as plain text (no special FTS operators). Set to false to use PostgreSQL tsquery syntax. Defaults to true.

Default: true
languagestring · nullableOptional

Language used for full-text search stemming. Defaults to english.

Default: english
limitinteger · nullableOptional

Maximum number of rows to return. Defaults to 100.

Default: 100
offsetinteger · nullableOptional

Number of rows to skip before returning results. Used for pagination.

Default: null
fieldsany of · nullableOptional

Columns to include in the response. Pass a comma-separated string or a list. Defaults to all fields.

Default: null
string[]Optional
or
stringOptional
sortstring · nullableOptional

Comma-separated list of fields to sort by, with optional asc/desc direction. Example: "fieldname1 asc, fieldname2 desc".

Default: null
include_totalboolean · nullableOptional

Include the total number of matching rows in the response. Defaults to true.

Default: true
total_estimation_thresholdinteger · nullableOptional

When include_total is true and the estimated row count exceeds this threshold, CKAN returns an estimated total rather than an exact count. Set to null (default) to always return an exact count.

Default: null
records_formatstring · enum · nullableOptional

Format for the returned records. objects returns a list of dicts, lists returns a list of lists, csv and tsv return delimited strings. Defaults to objects.

Default: objectsPossible values:
Responses
200

Successful response.

application/json
helpstringRequired

URL to the API documentation for this action.

successbooleanRequired

Whether the request succeeded.

post/datastore_search

Query a DataStore resource with SQL

get

Execute a SQL SELECT statement against one or more DataStore resources. Useful for aggregations, joins, and complex filtering that datastore_search cannot express.

Only SELECT statements are permitted.

Authorizations
AuthorizationstringRequired

HDX API token. Required for all Tabular Data Endpoint requests, including public resources.

Query parameters
sqlstringRequired

A single SQL SELECT statement to execute against the DataStore. Required. Only SELECT statements are permitted — INSERT, UPDATE, DELETE, and DDL statements are not allowed. Table names correspond to resource IDs (e.g. SELECT * FROM "<resource_id>").

Responses
200

Successful response.

application/json
helpstringRequired

URL to the API documentation for this action.

successbooleanRequired

Whether the request succeeded.

get/datastore_search_sql

Query a DataStore resource with SQL (POST)

post

Identical to the GET form. Use POST for long SQL statements.

Authorizations
AuthorizationstringRequired

HDX API token. Required for all Tabular Data Endpoint requests, including public resources.

Body
sqlstringRequired

A single SQL SELECT statement to execute against the DataStore. Required. Only SELECT statements are permitted — INSERT, UPDATE, DELETE, and DDL statements are not allowed. Table names correspond to resource IDs (e.g. SELECT * FROM "<resource_id>").

Responses
200

Successful response.

application/json
helpstringRequired

URL to the API documentation for this action.

successbooleanRequired

Whether the request succeeded.

post/datastore_search_sql

Last updated

Was this helpful?