Query Examples
This page collects concrete query examples you can adapt in your own integration.
Find a set by name
Lookup a set tagged with us_state by its name property.
bash
curl -X POST https://dev-jeb.com/deliberate/api/external/v1/query \
-H "Authorization: Bearer DELIBERATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"where": {
"tags": {"contains": "us_state"},
"properties": {"name": {"eq": "South Carolina"}}
},
"limit": 100
}'What's at this location?
Use a spatial contains_point filter to find sets that contain a given latitude/longitude.
bash
curl -X POST https://dev-jeb.com/deliberate/api/external/v1/query \
-H "Authorization: Bearer DELIBERATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"where": {
"spatial": {
"contains_point": {
"lat": 34.0007,
"lng": -81.0348
}
}
},
"limit": 100
}'Find all national parks in the state of Utah
First we find the state of Utah through tag and name. Then we find all sets that are a subset of the state of Utah. This is done by using the relationships filter with the SUBSET type and outbound direction. Finally we filter for sets tagged with us_national_park.
bash
curl -X POST https://dev-jeb.com/deliberate/api/external/v1/query \
-H "Authorization: Bearer DELIBERATE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"where": {
"tags": {
"contains": "us_national_park"
},
"relationships": {
"type": "SUBSET",
"direction": "outbound",
"to": {
"tags": {
"contains": "us_state"
},
"properties": {
"name": {
"eq": "Utah"
}
}
}
}
},
"limit": 100,
"offset": 0
}'