Returns the dataset models for all datasets. Use the Range header to specify the number of datasets returned (maximum 1,000; default is the first 20).

By default you don’t get any snapshot data. If you set row_limit > 0, the API returns the specified number of data records (rows) from each snapshot as well (maximum 10,000 rows).

You can restrict the datasets returned by specifying the parent_collection_id, the query parameter, or the filter parameter.

Query parameters

NameTypeDescriptionRequired?
filter array Returns only datasets where the specified attribute matches the specified value1. Currently display_name, created_at, data_updated_at, and schema_updated_at are the only attributes supported. You cannot combine this parameter with the query parameter. Note that date comparisons are non-inclusive (i.e. '<=' and '<' are interchangeable in this query: ?filter=data_updated_at<=2018-04-06). false
has_tag array Returns only datasets tagged with the specified tags (for example, has_tag=construction&has_tag=real%20estate). If you specify multiple tags, the API returns datasets with any of the tags (OR). false
in_collection_id string Works in conjunction with query and returns only rows from datasets within the specified collection (including its child collections). false
include_serialids boolean Set include_serialids=true to include the Enigma Serial ID field in the row data (default is false). The serial ID is row identifier added by Enigma that is unique within the current snapshot. false
match_metadata boolean Works in conjunction with query. When true, the API searches for datasets where there is a match within the dataset metadata. When false, the API does not search the metadata for matches. Default is true. false
match_rows boolean Works in conjunction with query. When true, the API searches for datasets where there is a match within the data records (rows). When false, the API does not search the data records for matches. Default is true. false
max_row_count integer Returns only datasets with less than the specified number of rows. false
min_row_count integer Returns only datasets with at least the specified number of rows. false
mode string Values: advanced phrase simple
Defaults to simple.
false
parent_collection_id array Returns only datasets whose immediate parent collection ID matches the one specified here. You can use this to identify all the datasets, plus the current snapshot ID for each, within a given collection. false
phrase_distance integer If mode=phrase, this specifies the proximity search distance. For example, if query=sovereign%20country and phrase_distance=0, the two words must be next to each other. If phrase_distance=1, it also matches 'sovereign island country'. false
query string Query string to return only rows that contain specific information (must set row_limit > 0)3. You cannot combine this with the filter parameter. false
row_limit integer Number of rows to return for each dataset (default is 0; maximum 10,000). false
row_offset integer Number of rows to skip at the beginning of the snapshot (for example, row_offset=10 skips the first 10 rows). false
row_sort string Specifies the field used to sort the records within the dataset (must set row_limit > 0). If you specify row_offset as well, the records are sorted first and then the offset is applied. Prepend the field name with a minus sign (-) to specify descending order (defaults to ascending). false
sort array List of dataset attributes indicating how to sort the datasets2. display_name, created_at, data_updated_at, and schema_updated_at are supported. For example, sort=-created_at sorts the datasets by creation date, with the most recent listed first. display_name is the default sort attribute. You cannot combine this with the query parameter. false

1 See Using the filter parameter below.

2 See Using the sort parameter below.

3 See Using the query parameter below.

Using the filter parameter

The examples below show how to use the filter parameter. Note that display_name, created_at, and data_updated_at are the only attributes currently supported:

  • filter=display_name=PhilGEPS%20-%20Awards returns only datasets named “PhilGEPS - Awards.” It works for exact matches only.
  • filter=display_name<G returns only datasets with names with first letter less than ‘G’.
  • filter=data_updated_at>2017-11-29 returns datasets with snapshots updated since the specified date.

Using the sort parameter

The sort parameter determines the order in which datasets are returned by the API. The default is by display_name in ascending order, but you can also sort by created_at, data_updated_at, and schema_updated_at. To sort in descending order, include a minus sign, for example, sort='-created_at'.

For datasets that haven’t been updated, data_updated_at and schema_updated_at will be null. Null values are returned as “the most recent,” so if you want to sort by -data_updated_at or -schema_updated_at to obtain the most recently updated datasets, you’ll need to filter out those with null values. You can do this using the filter parameter with the value >1970, for example ?sort=-data_updated_at&filter=data_updated_at>1970.

Using the query parameter

The query parameter lets you specify a search string. If you do, the API returns only rows containing the words you specify. Note that you must set row_limit to a value greater than 0 to get data records in the response.

If you specify multiple words, the default operator is AND, meaning the API returns rows containing all of the words specified. You can include the same advanced search operators supported by the Enigma Public UI to perform other operations, for example, query=enigma||technoligies~1&row_limit=10.

Try it out

Enter any desired query parameters and click Send to view the response:

GET https://public.enigma.com/api/datasets/?


Responses

CodeReturns
200 The dataset model for each dataset.
206 The dataset model for each dataset.
422 Unable to serialize entity

Example

This example returns the metadata for first dataset with the words “federal” and “reserve” in the dataset metadata or in at least one row of the dataset’s current snapshot. Since the example does not explicitly set row_limit > 0, the request does not return any data records.

$ curl -X GET 'https://public.enigma.com/api/datasets/?query=federal%20reserve' -H 'Range: resources=0-0'

To search for the phrase “federal reserve,” the query string would look like this: query=\"federal%20reserve\".