Free first
Catalog, then pack
Every integration should begin with free discovery. Start at
/api/v1/catalog, then inspect one pack detail page before making a paid call.
One full paid example is the minimum, but a first developer learns faster when each live flagship pack has one free discovery call and one narrow paid test query. These examples are meant to set expectations, not exhaust the whole contract.
Free first
Every integration should begin with free discovery. Start at
/api/v1/catalog, then inspect one pack detail page before making a paid call.
Paid second
The first paid test is supposed to challenge. An unpaid call to
/api/v1/query/dataset should return 402 before a payment retry.
Keep it narrow
Use one pack, one time slice or time range, a few regions, and a small limit. The goal is to understand the contract, not to benchmark the system on day one.
Start with the same two free requests no matter which pack you plan to use:
curl https://app.daedalmap.com/api/v1/catalog
curl https://app.daedalmap.com/api/v1/packs/earthquakes
Currency is the easiest first pack if you want a clean panel-style example.
The free pack call tells you the available sources and granularity model. The paid
test call below should return 402 without payment and data after a successful retry.
curl https://app.daedalmap.com/api/v1/packs/currency
curl -X POST https://app.daedalmap.com/api/v1/query/dataset \
-H "Content-Type: application/json" \
-d '{
"request_id": "docs_currency_example",
"pack_id": "currency",
"metrics": ["local_per_usd"],
"filters": {
"region_ids": ["ARG", "BRA", "CHL"],
"time": {
"start": "2024-01-01",
"end": "2024-03-31",
"granularity": "monthly"
}
},
"sort": {
"field": "date",
"direction": "asc"
},
"limit": 12,
"output": {
"format": "rows",
"include_provenance": true
}
}'
Earthquakes are a good first event-style pack. This narrow call asks for one metric, one time window, and three regions.
curl https://app.daedalmap.com/api/v1/packs/earthquakes
curl -X POST https://app.daedalmap.com/api/v1/query/dataset \
-H "Content-Type: application/json" \
-d '{
"request_id": "docs_earthquakes_example",
"source_id": "earthquakes_events",
"metrics": ["event_count"],
"filters": {
"region_ids": ["JPN", "CHL", "IDN"],
"time": {
"value": 2011
}
},
"sort": {
"field": "value",
"direction": "desc"
},
"limit": 25,
"output": {
"format": "rows",
"include_provenance": true
}
}'
Volcanoes now sit in the same live agent lane. The first test below uses the same basic event-count pattern as earthquakes so the comparison is easy to understand.
curl https://app.daedalmap.com/api/v1/packs/volcanoes
curl -X POST https://app.daedalmap.com/api/v1/query/dataset \
-H "Content-Type: application/json" \
-d '{
"request_id": "docs_volcanoes_example",
"source_id": "volcanoes_events",
"metrics": ["event_count"],
"filters": {
"region_ids": ["IDN", "JPN", "CHL"],
"time": {
"value": 2020
}
},
"sort": {
"field": "value",
"direction": "desc"
},
"limit": 25,
"output": {
"format": "rows",
"include_provenance": true
}
}'
Tsunamis are the main pack where region routing looks a little different. You can still
use country-style ids like JPN, but you may also see ocean-region ids like
XOO. That is expected.
curl https://app.daedalmap.com/api/v1/packs/tsunamis
curl -X POST https://app.daedalmap.com/api/v1/query/dataset \
-H "Content-Type: application/json" \
-d '{
"request_id": "docs_tsunamis_example",
"source_id": "tsunamis_events",
"metrics": ["event_count"],
"filters": {
"region_ids": ["JPN", "IDN", "XOO"],
"time": {
"value": 2011
}
},
"sort": {
"field": "value",
"direction": "desc"
},
"limit": 25,
"output": {
"format": "rows",
"include_provenance": true
}
}'
Expected result
The unpaid version of each paid test should return 402. That is the expected
first result. A client that supports the payment lane should then retry with payment and
receive the protected data.