Query Functions

There a few functions that you can apply to queries to gather even more insight into the data.

You can retrieve a listing of the available functions in a dataset with the following request:

GET /dataset/<DATASET_ID> HTTP/1.1
Authorization: token 01234567890123456789
X-API-Version: 20151130

A sample response is as follows:

{
    ...
    "id": "job_listings",
    "truncate_limit": 500000,
    "functions": {
        "genderdecoder": {
            "description": "Analyze potential gender bias in job listings.",
            "blog_url": "https://blog.thinknum.com/job-listings/"
        },
        "sales": {
            "description": "See which individual jobs have been filled within the defined Lookahead Days. ",
            "blog_url": "https://blog.thinknum.com/job-listings/#recruitment-analysis-function"
        },
        "changeovertime": {
            "description": "Calculate the difference between a data point today and a user defined frequency.",
            "blog_url": "https://blog.thinknum.com/change-over-time/"
        }
    },
    ...
}

Note: Currently, you can only apply functions against the “Store Locations” dataset.

Nearby Competitors

This is a function that can be applied to queries that contain coordinate data. For each item in the query, It provides a count of the numbers of competitors (provided in a list either by ticker and/or entity) within a specified distance.

The nearby function has the following parameters:

ParameterDescriptionRequired?
datasetThe dataset of the competitorsYes
tickersList of competitor tickersNo, if entities is defined;
yes, otherwise.
entitiesList of competitor entitiesNo, if tickers is defined;
yes, otherwise.
distanceThe radius in miles to consider as "nearby"Yes

For example, if you are analyzing the "Store Locations" dataset, and you would like to see how many Ralph Lauren stores are within 5 miles of each Nordstrom store, you can run the following query:

POST /dataset/store/query/ HTTP/1.1
Authorization: token 01234567890123456789
X-API-Version: 20151130

{
    "tickers": [
        "nyse:jwn"
    ],
    "functions": [
        {
            "function": "nearby",
            "parameters": {
                "dataset": "store",
                "dataset_type": "dataset",
                "distance": 5,
                "entities": [],
                "is_include_closed": false,
                "tickers": [
                    "nyse:rl"
                ]
            }
        }
    ]
}
curl -X POST "https://data.thinknum.com/datasets/store/query/" \
-H "Accept: application/json" \
-H "X-API-Version: 20151130" \
-H "Authorization: token 01234567890123456789" \
-d $'{
    "tickers": [
        "nyse:jwn"
    ],
    "functions": [
        {
            "function": "nearby",
            "parameters": {
                "dataset": "store",
                "dataset_type": "dataset",
                "distance": 5,
                "entities": [],
                "is_include_closed": false,
                "tickers": [
                    "nyse:rl"
                ]
            }
        }
    ]
}'
response = requests.post(
    url='https://data.thinknum.com/datasets/store/query/', 
    headers={
        'Authorization': 'token 01234567890123456789', 
        'X-API-Version': '20151130', 
        'Accept': 'application/json'
    }, 
    data=json.dumps({
        "tickers": [
            "nyse:jwn"
        ],
        "functions": [
            {
                "function": "nearby",
                "parameters": {
                    "dataset": "store",
                    "dataset_type": "dataset",
                    "distance": 5,
                    "entities": [],
                    "is_include_closed": false,
                    "tickers": [
                        "nyse:rl"
                    ]
                }
            }
        ]
    })
)
results = json.loads(response.text)

A sample response follows:

{
    "state": "running",
    "total": 0,
    "id": "33afc36bb52fcb5e26aaf94ddfb2c91341a2a673bb1210341dcc1764a955c9cd",
    "formats": [
        "application/vnd.thinknum.table+json",
        "application/vnd.thinknum.map+json"
    ]
}

To check if query is done:

HEAD datasets/store/query/33afc36bb52fcb5e26aaf94ddfb2c91341a2a673bb1210341dcc1764a955c9cd HTTP/1.1
Authorization: token 01234567890123456789
X-API-Version: 20151130
Accept: application/vnd.thinknum.table+json
Content-Type: application/x-www-form-urlencoded; charset=utf-8
curl -I HEAD "https://data.thinknum.com/datasets/store/query/33afc36bb52fcb5e26aaf94ddfb2c91341a2a673bb1210341dcc1764a955c9cd" \
-H "Accept: application/vnd.thinknum.table+json" \
-H "X-API-Version: 20151130" \
-H "Authorization: token 01234567890123456789"
response = requests.head(
    url='https://data.thinknum.com/datasets/store/query/33afc36bb52fcb5e26aaf94ddfb2c91341a2a673bb1210341dcc1764a955c9cd', 
    headers={
        'Authorization': 'token 01234567890123456789', 
        'X-API-Version': '20151130', 
        'Accept': 'application/vnd.thinknum.table+json'
    }
)
results = dict(response.headers)

A sample response follows:

HTTP/1.1 200 OK
Server: nginx
Date: Wed, 28 Apr 2021 16:23:07 GMT
Content-Type: application/json
Connection: keep-alive
X-Truncated: false
X-Formats: application/vnd.thinknum.table+json, application/vnd.thinknum.map+json, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
X-Total: 963
X-State: complete
Strict-Transport-Security: max-age=15768000

To retrieve data:

GET /datasets/store/query/33afc36bb52fcb5e26aaf94ddfb2c91341a2a673bb1210341dcc1764a955c9cd?limit=10&start=1
Authorization: token 01234567890123456789
X-API-Version: 20151130
Accept: application/vnd.thinknum.table+json
Content-Type: application/json
curl -X GET "https://data.thinknum.com/datasets/store/query/33afc36bb52fcb5e26aaf94ddfb2c91341a2a673bb1210341dcc1764a955c9cd?limit=10&start=1" \
-H "Accept: application/vnd.thinknum.table+json" \
-H "Content-Type: application/json" \
-H "X-API-Version: 20151130" \
-H "Authorization: token 01234567890123456789"
response = requests.get(
    url='https://data.thinknum.com/datasets/store/query/33afc36bb52fcb5e26aaf94ddfb2c91341a2a673bb1210341dcc1764a955c9cd', 
    headers={
        'Authorization': 'token 01234567890123456789', 
        'X-API-Version': '20151130', 
        'Accept': 'application/vnd.thinknum.table+json'
    }
)
results = json.loads(response.text)

A sample response follows:

{
    "group_fields": [
        {
            "length": 320,
            "options": [],
            "display_name": "Ticker Symbol",
            "format": "ticker",
            "metric": false,
            "type": "string",
            "id": "dataset__entity__entity_ticker__ticker__ticker",
            "summary": "The full ticker symbol, defined as the financial market of the company, followed by a colon (:), and then the identifier of the company. ex. NASDAQ:AAPL"
        },
        {
            "length": 255,
            "options": [],
            "display_name": "Entity Name",
            "format": null,
            "metric": false,
            "type": "string",
            "id": "dataset__entity__name",
            "summary": "The name of a specific entity belonging to a ticker within this dataset."
        },
        ...
        {
            "length": null,
            "options": [],
            "display_name": "Competition #1",
            "format": null,
            "metric": true,
            "type": "number",
            "id": "$nearby_1@count",
            "summary": ""
        }
    ],
    "total": 963,
    "id": "33afc36bb52fcb5e26aaf94ddfb2c91341a2a673bb1210341dcc1764a955c9cd",
    "count": 10,
    "rows": [
        [
            "nyse:jwn",
            "Nordstrom",
            ...
            0
        ],
        ...
        [
            "nyse:jwn",
            "Nordstrom",
            ...
            2
        ]
    ],
    "fields": [
        {
            "display_name": "Ticker Symbol",
            "format": "ticker",
            "metric": false,
            "id": "dataset__entity__entity_ticker__ticker__ticker",
            "length": 320,
            "summary": "The full ticker symbol, defined as the financial market of the company, followed by a colon (:), and then the identifier of the company. ex. NASDAQ:AAPL",
            "type": "string",
            "options": []
        },
        {
            "display_name": "Entity Name",
            "format": null,
            "metric": false,
            "id": "dataset__entity__name",
            "length": 255,
            "summary": "The name of a specific entity belonging to a ticker within this dataset.",
            "type": "string",
            "options": []
        },
        ...
        {
            "display_name": "Competition #1",
            "format": null,
            "metric": true,
            "id": "$nearby_1@count",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        }
    ],
    "sort_fields": [],
    "start": 1,
    "state": "complete",
    "limit": 10,
    "last_date_updated": "2021-03-26T16:00:35Z"
}

Nearest Competitor

While the Nearby Competitors function returns a count of the competitors within a specified distance, the Nearest Competitor returns the closest competitor for each item in the query.

The Nearest Competitor function has the following parameters:

ParmeterDescriptionRequired?
datasetThe dataset of the competitorsYes
tickersList of competitor tickersNo, if entities is defined;
yes, otherwise.
entitiesList of competitor entitiesNo, if tickers is defined;
yes, otherwise.

For example, if you are analyzing the "Store Locations" dataset, and you would like to see how close each Nordstrom store is to a Ralph Lauren store, you can run the following query:

POST /dataset/store/query/ HTTP/1.1
Authorization: token 01234567890123456789
X-API-Version: 20151130

{
    "tickers": [
        "nyse:jwn"
    ],
    "functions": [
        {
            "function": "nearest",
            "parameters": {
                "dataset_type": "dataset",
                "dataset": "store",
                "tickers": [
                    "nyse:rl"
                ],
                "entities": [],
                "ranks": [
                    1
                ],
                "is_include_closed": false
            }
        }
    ]
}
curl -X POST "https://data.thinknum.com/datasets/store/query/" \
-H "Accept: application/json" \
-H "X-API-Version: 20151130" \
-H "Authorization: token 01234567890123456789" \
-d $'{
    "tickers": [
        "nyse:jwn"
    ],
    "functions": [
        {
            "function": "nearest",
            "parameters": {
                "dataset_type": "dataset",
                "dataset": "store",
                "tickers": [
                    "nyse:rl"
                ],
                "entities": [],
                "ranks": [
                    1
                ],
                "is_include_closed": false
            }
        }
    ]
}'
response = requests.post(
    url='https://data.thinknum.com/datasets/store/query/', 
    headers={
        'Authorization': 'token 01234567890123456789', 
        'X-API-Version': '20151130', 
        'Accept': 'application/json'
    }, 
    data=json.dumps({
        "tickers": [
            "nyse:jwn"
        ],
        "functions": [
            {
                "function": "nearest",
                "parameters": {
                    "dataset_type": "dataset",
                    "dataset": "store",
                    "tickers": [
                        "nyse:rl"
                    ],
                    "entities": [],
                    "ranks": [
                        1
                    ],
                    "is_include_closed": false
                }
            }
        ]
    })
)
results = json.loads(response.text)

A sample response follows:

{
    "state": "complete",
    "total": 963,
    "id": "dfe76829a25074868ee8018ac2c2d0cdc074c3e86ec80f9897ee41570950f441",
    "formats": [
        "application/vnd.thinknum.table+json",
        "application/vnd.thinknum.map+json"
    ]
}

To check if query is completed:

HEAD datasets/store/query/dfe76829a25074868ee8018ac2c2d0cdc074c3e86ec80f9897ee41570950f441 HTTP/1.1
Authorization: token 01234567890123456789
X-API-Version: 20151130
Accept: application/vnd.thinknum.table+json
Content-Type: application/x-www-form-urlencoded; charset=utf-8
curl -I HEAD "https://data.thinknum.com/datasets/store/query/dfe76829a25074868ee8018ac2c2d0cdc074c3e86ec80f9897ee41570950f441" \
-H "Accept: application/vnd.thinknum.table+json" \
-H "X-API-Version: 20151130" \
-H "Authorization: token 01234567890123456789"
response = requests.head(
    url='https://data.thinknum.com/datasets/store/query/dfe76829a25074868ee8018ac2c2d0cdc074c3e86ec80f9897ee41570950f441', 
    headers={
        'Authorization': 'token 01234567890123456789', 
        'X-API-Version': '20151130', 
        'Accept': 'application/vnd.thinknum.table+json'
    }
)
results = dict(response.headers)

A sample response follows:

HTTP/1.1 200 OK
Server: nginx
Date: Wed, 28 Apr 2021 16:29:50 GMT
Content-Type: application/json
Connection: keep-alive
X-Truncated: false
X-Formats: application/vnd.thinknum.table+json, application/vnd.thinknum.map+json, text/csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
X-Total: 963
X-State: complete
Strict-Transport-Security: max-age=15768000

To retrieve data:

GET /datasets/store/query/dfe76829a25074868ee8018ac2c2d0cdc074c3e86ec80f9897ee41570950f441?limit=10&start=1
Authorization: token 01234567890123456789
X-API-Version: 20151130
Accept: application/vnd.thinknum.table+json
Content-Type: application/json
curl -X GET "https://data.thinknum.com/datasets/store/query/dfe76829a25074868ee8018ac2c2d0cdc074c3e86ec80f9897ee41570950f441?limit=10&start=1" \
-H "Accept: application/vnd.thinknum.table+json" \
-H "Content-Type: application/json" \
-H "X-API-Version: 20151130" \
-H "Authorization: token 01234567890123456789"
response = requests.get(
    url='https://data.thinknum.com/datasets/store/query/dfe76829a25074868ee8018ac2c2d0cdc074c3e86ec80f9897ee41570950f441', 
    headers={
        'Authorization': 'token 01234567890123456789', 
        'X-API-Version': '20151130', 
        'Accept': 'application/vnd.thinknum.table+json'
    }
)
results = json.loads(response.text)

A sample response follows:

{
    "group_fields": [
        {
            "length": 320,
            "options": [],
            "display_name": "Ticker Symbol",
            "format": "ticker",
            "metric": false,
            "type": "string",
            "id": "dataset__entity__entity_ticker__ticker__ticker",
            "summary": "The full ticker symbol, defined as the financial market of the company, followed by a colon (:), and then the identifier of the company. ex. NASDAQ:AAPL"
        },
        {
            "length": 255,
            "options": [],
            "display_name": "Entity Name",
            "format": null,
            "metric": false,
            "type": "string",
            "id": "dataset__entity__name",
            "summary": "The name of a specific entity belonging to a ticker within this dataset."
        },
        ...
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Store #1",
            "format": null,
            "metric": false,
            "type": "number",
            "id": "$nearest_1_1.rank",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Ticker #1",
            "format": null,
            "metric": false,
            "type": "number",
            "id": "$nearest_1_1.ticker",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Entity #1",
            "format": null,
            "metric": false,
            "type": "number",
            "id": "$nearest_1_1.entity",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Distance #1",
            "format": null,
            "metric": true,
            "type": "number",
            "id": "$nearest_1_1.dist",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Store Name #1",
            "format": null,
            "metric": false,
            "type": "number",
            "id": "$nearest_1_1.storefront_name",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Store Street #1",
            "format": null,
            "metric": false,
            "type": "number",
            "id": "$nearest_1_1.street",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Store City #1",
            "format": null,
            "metric": false,
            "type": "number",
            "id": "$nearest_1_1.city",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Store State #1",
            "format": null,
            "metric": false,
            "type": "number",
            "id": "$nearest_1_1.state",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Store Country #1",
            "format": null,
            "metric": false,
            "type": "number",
            "id": "$nearest_1_1.country",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Store Postal Code #1",
            "format": null,
            "metric": false,
            "type": "number",
            "id": "$nearest_1_1.postal_code",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Nearest Store Is Closed #1",
            "format": null,
            "metric": false,
            "type": "boolean",
            "id": "$nearest_1_1.is_closed",
            "summary": ""
        }
    ],
    "total": 963,
    "id": "dfe76829a25074868ee8018ac2c2d0cdc074c3e86ec80f9897ee41570950f441",
    "count": 10,
    "rows": [
        [
            "nyse:jwn",
            "Nordstrom",
            ...
            1,
            "nyse:rl",
            "Ralph Lauren",
            29.2719080003088,
            "RALPH LAUREN",
            "Houston Galleria, 5015 Westheimer",
            "Houston, TX",
            "TX",
            "USA",
            "77056",
            false
        ],
        ...
        [
            "nyse:jwn",
            "Nordstrom",
            ...
            1,
            "nyse:rl",
            "Ralph Lauren",
            41.8697883953577,
            "POLO RALPH LAUREN FACTORY STORE",
            "Edinburgh Premium Outlets, 3026 Outlet Drive, Suite G - 040",
            "Edinburgh, IN",
            "IN",
            "USA",
            "46124",
            false
        ]
    ],
    "fields": [
        {
            "display_name": "Ticker Symbol",
            "format": "ticker",
            "metric": false,
            "id": "dataset__entity__entity_ticker__ticker__ticker",
            "length": 320,
            "summary": "The full ticker symbol, defined as the financial market of the company, followed by a colon (:), and then the identifier of the company. ex. NASDAQ:AAPL",
            "type": "string",
            "options": []
        },
        {
            "display_name": "Entity Name",
            "format": null,
            "metric": false,
            "id": "dataset__entity__name",
            "length": 255,
            "summary": "The name of a specific entity belonging to a ticker within this dataset.",
            "type": "string",
            "options": []
        },
        ...
        {
            "display_name": "Nearest Store #1",
            "format": null,
            "metric": false,
            "id": "$nearest_1_1.rank",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Nearest Ticker #1",
            "format": null,
            "metric": false,
            "id": "$nearest_1_1.ticker",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Nearest Entity #1",
            "format": null,
            "metric": false,
            "id": "$nearest_1_1.entity",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Nearest Distance #1",
            "format": null,
            "metric": true,
            "id": "$nearest_1_1.dist",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Nearest Store Name #1",
            "format": null,
            "metric": false,
            "id": "$nearest_1_1.storefront_name",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Nearest Store Street #1",
            "format": null,
            "metric": false,
            "id": "$nearest_1_1.street",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Nearest Store City #1",
            "format": null,
            "metric": false,
            "id": "$nearest_1_1.city",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Nearest Store State #1",
            "format": null,
            "metric": false,
            "id": "$nearest_1_1.state",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Nearest Store Country #1",
            "format": null,
            "metric": false,
            "id": "$nearest_1_1.country",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Nearest Store Postal Code #1",
            "format": null,
            "metric": false,
            "id": "$nearest_1_1.postal_code",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Nearest Store Is Closed #1",
            "format": null,
            "metric": false,
            "id": "$nearest_1_1.is_closed",
            "length": null,
            "summary": "",
            "type": "boolean",
            "options": []
        }
    ],
    "sort_fields": [],
    "start": 1,
    "state": "complete",
    "limit": 10,
    "last_date_updated": "2021-03-26T16:00:35Z"
}

Sales Analyzer

This is a function that can be applied to "Car Inventory" dataset to see which cars have been sold. Since each vehicle has a unique identification number, users are able to see when a vehicle is added or removed. Tracking the number of vehicles leaving inventory allows users to predict sales figures

The sales function has the following parameters:

ParameterDescriptionRequired
lookahead_day_countThe number of days in the future that will be checked to see if same VIN returnsYes

For example, if you are analyzing the "Car Inventory" dataset, and you would like to see which car have been sold from Carvana, you can run the following query:

POST /dataset/store/query/ HTTP/1.1
Authorization: token 01234567890123456789
X-API-Version: 20151130

{
    "tickers": [
        "nyse:cvna"
    ],
    "filters": [
        {
            "column": "as_of_date",
            "type": "[]",
            "value": [
                "2021-01-01",
                "2021-01-31"
            ]
        }
    ],
    "functions": [
        {
            "function": "sales",
            "parameters": {
                "lookahead_day_count": 2
            }
        }
    ]
}
curl -X POST "https://data.thinknum.com/datasets/store/query/" \
-H "Accept: application/json" \
-H "X-API-Version: 20151130" \
-H "Authorization: token 01234567890123456789" \
-d $'{
    "tickers": [
        "nyse:cvna"
    ],
    "filters": [
        {
            "column": "as_of_date",
            "type": "[]",
            "value": [
                "2021-01-01",
                "2021-01-31"
            ]
        }
    ],
    "functions": [
        {
            "function": "sales",
            "parameters": {
                "lookahead_day_count": 2
            }
        }
    ]
}'
response = requests.post(
    url='https://data.thinknum.com/datasets/store/query/', 
    headers={
        'Authorization': 'token 01234567890123456789', 
        'X-API-Version': '20151130', 
        'Accept': 'application/json'
    }, 
    data=json.dumps({
        "tickers": [
            "nyse:cvna"
        ],
        "filters": [
            {
                "column": "as_of_date",
                "type": "[]",
                "value": [
                    "2021-01-01",
                    "2021-01-31"
                ]
            }
        ],
        "functions": [
            {
                "function": "sales",
                "parameters": {
                    "lookahead_day_count": 2
                }
            }
        ]
    })
)
results = json.loads(response.text)

A sample response follows:

{
    "state": "running",
    "total": 0,
    "id": "bb6a3c405cbe2fff1c5522892aecabf7a7a8b83549d3567ce16d4146cc930d23",
    "formats": [
        "application/vnd.thinknum.table+json"
    ]
}

To check if query is completed:

HEAD datasets/store/query/bb6a3c405cbe2fff1c5522892aecabf7a7a8b83549d3567ce16d4146cc930d23 HTTP/1.1
Authorization: token 01234567890123456789
X-API-Version: 20151130
Accept: application/vnd.thinknum.table+json
Content-Type: application/x-www-form-urlencoded; charset=utf-8
curl -I HEAD "https://data.thinknum.com/datasets/store/query/bb6a3c405cbe2fff1c5522892aecabf7a7a8b83549d3567ce16d4146cc930d23" \
-H "Accept: application/vnd.thinknum.table+json" \
-H "X-API-Version: 20151130" \
-H "Authorization: token 01234567890123456789"
response = requests.head(
    url='https://data.thinknum.com/datasets/store/query/bb6a3c405cbe2fff1c5522892aecabf7a7a8b83549d3567ce16d4146cc930d23', 
    headers={
        'Authorization': 'token 01234567890123456789', 
        'X-API-Version': '20151130', 
        'Accept': 'application/vnd.thinknum.table+json'
    }
)
results = dict(response.headers)

A sample response follows:

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 29 Apr 2021 17:53:59 GMT
Content-Type: application/json
Connection: keep-alive
X-Truncated: true
X-Formats: application/vnd.thinknum.table+json, text/csv
X-Total: 500000
X-State: complete
Strict-Transport-Security: max-age=15768000

To retrieve data:

GET /datasets/store/query/bb6a3c405cbe2fff1c5522892aecabf7a7a8b83549d3567ce16d4146cc930d23?limit=10&start=1
Authorization: token 01234567890123456789
X-API-Version: 20151130
Accept: application/vnd.thinknum.table+json
Content-Type: application/json
curl -X GET "https://data.thinknum.com/datasets/store/query/bb6a3c405cbe2fff1c5522892aecabf7a7a8b83549d3567ce16d4146cc930d23?limit=10&start=1" \
-H "Accept: application/vnd.thinknum.table+json" \
-H "Content-Type: application/json" \
-H "X-API-Version: 20151130" \
-H "Authorization: token 01234567890123456789"
response = requests.get(
    url='https://data.thinknum.com/datasets/store/query/bb6a3c405cbe2fff1c5522892aecabf7a7a8b83549d3567ce16d4146cc930d23', 
    headers={
        'Authorization': 'token 01234567890123456789', 
        'X-API-Version': '20151130', 
        'Accept': 'application/vnd.thinknum.table+json'
    }
)
results = json.loads(response.text)

A sample response follows:

{
    "group_fields": [
        {
            "length": 320,
            "options": [],
            "display_name": "Ticker Symbol",
            "format": "ticker",
            "metric": false,
            "type": "string",
            "id": "dataset__entity__entity_ticker__ticker__ticker",
            "summary": "The full ticker symbol, defined as the financial market of the company, followed by a colon (:), and then the identifier of the company. ex. NASDAQ:AAPL"
        },
        ...
        {
            "length": null,
            "options": [],
            "display_name": "Is Sold",
            "format": null,
            "metric": false,
            "type": "boolean",
            "id": "is_sold",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Sold (2 Lookahead Days)",
            "format": null,
            "metric": false,
            "type": "boolean",
            "id": "$sales_1#sold",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Days filled",
            "format": null,
            "metric": true,
            "type": "number",
            "id": "$sales_1#days_filled",
            "summary": ""
        },
        {
            "length": null,
            "options": [],
            "display_name": "Days since posted",
            "format": null,
            "metric": true,
            "type": "number",
            "id": "$sales_1#days_since_posted",
            "summary": ""
        }
    ],
    "total": 500000,
    "id": "58caab53e58c7a4affafb703cc693065cff94043f21b5ba7814fce0a575cd305",
    "count": 10,
    "rows": [
        [
            "nyse:cvna",
            ...
            null,
            false,
            null,
            89
        ],
        ...
        [
            "nyse:cvna",
            ...
            null,
            false,
            null,
            89
        ]
    ],
    "fields": [
        {
            "display_name": "Ticker Symbol",
            "format": "ticker",
            "metric": false,
            "id": "dataset__entity__entity_ticker__ticker__ticker",
            "length": 320,
            "summary": "The full ticker symbol, defined as the financial market of the company, followed by a colon (:), and then the identifier of the company. ex. NASDAQ:AAPL",
            "type": "string",
            "options": []
        },
        ...
        {
            "display_name": "Is Sold",
            "format": null,
            "metric": false,
            "id": "is_sold",
            "length": null,
            "summary": "",
            "type": "boolean",
            "options": []
        },
        {
            "display_name": "Sold (2 Lookahead Days)",
            "format": null,
            "metric": false,
            "id": "$sales_1#sold",
            "length": null,
            "summary": "",
            "type": "boolean",
            "options": []
        },
        {
            "display_name": "Days filled",
            "format": null,
            "metric": true,
            "id": "$sales_1#days_filled",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        },
        {
            "display_name": "Days since posted",
            "format": null,
            "metric": true,
            "id": "$sales_1#days_since_posted",
            "length": null,
            "summary": "",
            "type": "number",
            "options": []
        }
    ],
    "sort_fields": [
        {
            "column": "as_of_date",
            "order": "desc"
        }
    ],
    "start": 1,
    "state": "complete",
    "limit": 10,
    "last_date_updated": "2021-04-25T00:07:33Z"
}