Enrich

Datasets can be enriched with Hex Tiles using the Studio Data SDK.

Method

POST https://data-api.foursquare.com/internal/v1/query HTTP/1.1

HTTP API

Enrichment is provided through the Query API, which can support a range of flexible queries. The following parameters describe a simple enrichment query.

Headers

HeaderDescription
Content-TypeMust be application/json. This header is required.
AcceptMay be _/_, application/json, text/csv, or application/vnd.apache.arrow.file. The response dataset will have the corresponding data format (by default, text/csv).

Body

The body of the request should be the parameters, encoded as a JSON blob.

Parameters
ParameterTypeRequiredDescription
typestringYesUse enrich to select the enrich process.
sourceIdstringYesThe UUID of the Hex Tile dataset for enrichment.
sourceColumnstring or
string array
YesThe label of the Hex Tile column for enrichment, or an array of labels for multiple columns.
targetTypestringYesMust be either "H3" or "LATLNG".
columnstringYes for type H3Column in target dataset containing H3 addresses.
latColumnstringYes for type LATLNGColumn in target dataset containing latitude values.
lngColumnstringYes for type LATLNGColumn in target dataset containing longitude values.
timeColumnstringYes for
temporal datasets.
Column in target dataset containing time values in epoch timestamp or ISO-8601 format.
timeIntervalstringNoTime interval to use for enrichment. The target time interval must be available in the Hex Tile dataset.
Accepted methods: YEAR, MONTH, DAY, and HOUR. Defaults to the finest available interval.
inputstring arrayYesArray containing a single object describing the target dataset, in the form {"type": "dataset", "uuid": <uuid>}

Examples

curl -X POST https://data-api.foursquare.com/internal/v1/datasets/hextile \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'Accept: text/csv' \
--data-raw '{
    "type": "enrich",
    "input": [
        {
            "type": "dataset",
            "uuid": "my-target-uuid"
        }
    ],
    "sourceId": "my-hex-tile-uuid",
    "sourceColumn": "some_value",
    "timeColumn": "date",
    "targetType": "LATLNG",
    "latColumn": "lat",
    "lngColumn": "lng"
}'