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
Header | Description |
---|---|
Content-Type | Must be application/json . This header is required. |
Accept | May 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
Parameter | Type | Required | Description |
---|---|---|---|
type | string | Yes | Use enrich to select the enrich process. |
sourceId | string | Yes | The UUID of the Hex Tile dataset for enrichment. |
sourceColumn | string or string array | Yes | The label of the Hex Tile column for enrichment, or an array of labels for multiple columns. |
targetType | string | Yes | Must be either "H3" or "LATLNG" . |
column | string | Yes for type H3 | Column in target dataset containing H3 addresses. |
latColumn | string | Yes for type LATLNG | Column in target dataset containing latitude values. |
lngColumn | string | Yes for type LATLNG | Column in target dataset containing longitude values. |
timeColumn | string | Yes for temporal datasets. | Column in target dataset containing time values in epoch timestamp or ISO-8601 format. |
timeInterval | string | No | Time 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. |
input | string array | Yes | Array 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"
}'