Developers
API, SDKs, AI agents and webhooks to use the public data of any place in your systems.
Quick start
The API delivers each place's public data with the same fields no matter which government published it. Each record says which official source it comes from and under which license.
- Create your accountIt is free for non-commercial use.
- Create a tokenIn your account → Tokens; give it only the permissions it needs.
- Make your first callWith any language or with an SDK.
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/datasets/D087/records?place=XA-NO&limit=5"from datlase import Datlase
dl = Datlase("dlk_…", base_url="https://datlase.com/api/v1")
for r in dl.records("D087", place="XA-NO", limit=5):
print(r["name"], r["place"]["name"])import { Datlase } from './datlase.js';
const dl = new Datlase('dlk_…', { baseUrl: 'https://datlase.com/api/v1' });
for await (const r of dl.records('D087', { place: 'XA-NO' }, 5)) console.log(r.name);require 'Datlase.php';
$dl = new Datlase\Client('dlk_…', 'https://datlase.com/api/v1');
foreach ($dl->records('D087', ['place' => 'XA-NO'], 5) as $r) echo $r['name'], PHP_EOL;source("datlase.R")
dl <- datlase("dlk_…", "https://datlase.com/api/v1")
head(dl_records(dl, "D087", place = "XA-NO", max = 5))Authentication and permissions
Send your token in the header Authorization: Bearer dlk_…. Each token belongs to an organization, uses its owner's plan and can be restricted:
| Permit | What it allows |
|---|---|
Query data read | Catalog, records, places and coverage (API and MCP). |
Alerts alerts | Alerts and webhooks. |
Analytics analytics | Analytics engine: compare places, series and indicators. |
Bulk downloads bulk | Bulk downloads. |
You can also restrict a token to certain IPs (or CIDR ranges), countries and datasets, and give it an expiration date. If a call does not comply, the response is 403 with the reason. Rotate tokens from your account: the new one inherits the settings and the old one stops working immediately.
API reference
Base: https://datlase.com/api/v1. Responses are JSON in UTF-8. Long lists are paged with cursor: pass the next_cursor from the previous response until it comes back empty.
Catalog
GET/datasetsDatasets with dataQuery data
Standard datasets that have records, with places, records, period and last load.
| Parameter | En | Type | Descripción |
|---|---|---|---|
q | consultation | string | Text to search. E.g.: transit |
country | consultation | string | Country (2-letter ISO). E.g.: XA |
place | consultation | string | Place code; includes everything under it. E.g.: XA-NO |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/datasets?q=tr%C3%A1nsito&country=XA"GET/datasets/{id}One datasetQuery data
Definition, standard fields and coverage by place.
| Parameter | En | Type | Descripción |
|---|---|---|---|
id required | route | string | Standard code. E.g.: D087 |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/datasets/D087"GET/dcatDCAT catalog (JSON-LD)Public
All datasets with data, one dataset per country, in DCAT 2. It is public: no token required.
| Parameter | En | Type | Descripción |
|---|---|---|---|
country | consultation | string | One country only (2-letter ISO). E.g.: XA |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/dcat?country=XA"GET/data.jsonDCAT-US catalog (data.json)Public
The same catalog in the data.json format read by open data search engines. Public.
| Parameter | En | Type | Descripción |
|---|---|---|---|
country | consultation | string | One country only. E.g.: XA |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/data.json?country=XA"Records
GET/datasets/{id}/recordsRecords of a datasetQuery data
Normalized records of any dataset, with their source and license. Paginate with a cursor.
| Parameter | En | Type | Descripción |
|---|---|---|---|
id required | route | string | Standard code. E.g.: D087 |
place | consultation | string | Place code; includes everything under it. E.g.: XA-NO |
from | consultation | string | From (YYYY-MM-DD). E.g.: 2025-01-01 |
to | consultation | string | To (YYYY-MM-DD). |
q | consultation | string | Text. |
since_ingested | consultation | string | Only what was loaded after this date and time (UTC). |
format | consultation | string | csv = the same page in CSV (the next cursor comes in X-Next-Cursor). |
limit | consultation | integer | Records per page (maximum depends on your plan). E.g.: 100 |
cursor | consultation | string | Value of next_cursor from the previous response. |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/datasets/D087/records?place=XA-NO&from=2025-01-01"GET/datasets/{id}/export.parquetFull download (Parquet or CSV)Bulk downloads
Up to 200 thousand records of a dataset in one Parquet (or .csv) file, with the same filters as /records. Readable by pandas, DuckDB, Spark or BigQuery. The X-Next-Cursor header tells you if there is more.
| Parameter | En | Type | Descripción |
|---|---|---|---|
id required | route | string | Standard code. E.g.: D124 |
place | consultation | string | Place code; includes everything under it. E.g.: XA-NO |
max | consultation | integer | Maximum records. E.g.: 100000 |
cursor | consultation | string | Value of next_cursor from the previous response. |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/datasets/D124/export.parquet?place=XA-NO&max=100000"GET/permitsBuilding permitsQuery data
Normalized permits (D124) with class, work type and value.
| Parameter | En | Type | Descripción |
|---|---|---|---|
place | consultation | string | Place code; includes everything under it. E.g.: XA-NO |
from | consultation | string | Issued since. E.g.: 2025-01-01 |
class | consultation | string | residential, commercial, industrial, mixed, other |
min_value | consultation | number | Minimum value. |
limit | consultation | integer | Records per page (maximum depends on your plan). E.g.: 100 |
cursor | consultation | string | Value of next_cursor from the previous response. |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/permits?place=XA-NO&from=2025-01-01"GET/incidentsCriminal incidentsQuery data
Normalized incidents (D055).
| Parameter | En | Type | Descripción |
|---|---|---|---|
place | consultation | string | Place code; includes everything under it. E.g.: XA-NO |
from | consultation | string | From. |
offense | consultation | string | Offense (text). |
limit | consultation | integer | Records per page (maximum depends on your plan). E.g.: 100 |
cursor | consultation | string | Value of next_cursor from the previous response. |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/incidents?place=XA-NO&limit=100"Analytics
GET/datasets/{id}/aggregateGroup and measure (columnar engine)Analytics
Counts, sums, averages or counts distinct values grouped by up to two columns, with filters. Answers in milliseconds by reading only the columns it needs.
| Parameter | En | Type | Descripción |
|---|---|---|---|
id required | route | string | Standard code. E.g.: D124 |
group | consultation | string | Columns to group by, comma separated. E.g.: permit_class |
metric | consultation | string | count, sum, avg, min, max or distinct. E.g.: sum |
of | consultation | string | Column to measure. E.g.: valuation |
bucket | consultation | string | For dates: year, month or day. |
where[] | consultation | string | Filter column:op:value (eq, ne, gt, gte, lt, lte, in, has). E.g.: work_type:eq:new |
place | consultation | string | Place code; includes everything under it. E.g.: XA-NO |
limit | consultation | integer | Groups to return. E.g.: 20 |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/datasets/D124/aggregate?group=permit_class&metric=sum"GET/datasets/{id}/columnsColumns and their profileQuery data
Columns available to group and measure, with their type, empties, range and most frequent values.
| Parameter | En | Type | Descripción |
|---|---|---|---|
id required | route | string | Standard code. E.g.: D133 |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/datasets/D133/columns"POST/askAsk the dataAnalytics
Ask in natural language; it answers with Datlase data and returns the steps it followed and the chart data. Requires the token's Analytics permission and counts toward your plan's daily question limit.
curl -X POST -H "Authorization: Bearer $DATLASE_TOKEN" -H "Content-Type: application/json" \
-d '{"question":"¿Qué estados tienen más delitos por cada 100 mil habitantes?"}' \
"https://datlase.com/api/v1/ask"GET/analytics/metricsIndicatorsAnalytics
Indicators available for analysis (ids such as D087:count, D124:sum:valuation or pop).
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/analytics/metrics"GET/analyticsCompare placesAnalytics
Values by place for one to three indicators, optionally per 100 thousand inhabitants, with the correlation between the first two.
| Parameter | En | Type | Descripción |
|---|---|---|---|
scope required | consultation | string | Place that contains the ones being compared. E.g.: XA |
level | consultation | string | children, state or city. E.g.: state |
metrics required | consultation | string | Comma-separated ids. E.g.: D087:count,pop |
from | consultation | integer | Start year. E.g.: 2024 |
to | consultation | integer | End year. E.g.: 2025 |
pc | consultation | integer | 1 = per 100 thousand inhabitants. E.g.: 1 |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/analytics?scope=XA&level=state&metrics=D087%3Acount%2Cpop"GET/analytics/seriesTime seriesAnalytics
Monthly or yearly series of an indicator for a place and the given places.
| Parameter | En | Type | Descripción |
|---|---|---|---|
scope required | consultation | string | Place. E.g.: XA |
metrics required | consultation | string | An indicator id. E.g.: D087:count |
places | consultation | string | Comma-separated codes. E.g.: XA-NO |
grain | consultation | string | month or year. E.g.: month |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/analytics/series?scope=XA&metrics=D087%3Acount"Changes
GET/changesChange log (CDC)Query data
Inserts, updates (with the fields that changed) and deletes in order. Keep next_since and send it on the next call to replicate without downloading everything. With wait it waits up to 25 s for something to arrive; with include=record it returns the current record.
| Parameter | En | Type | Descripción |
|---|---|---|---|
dataset | consultation | string | Standard code. E.g.: D116 |
place | consultation | string | Place code; includes everything under it. E.g.: XA-NO |
since | consultation | integer | Sequence number to continue from. E.g.: 0 |
op | consultation | string | insert, update or delete. |
include | consultation | string | record to include the record. E.g.: record |
wait | consultation | integer | Seconds to wait if there are no changes (maximum 25). E.g.: 0 |
limit | consultation | integer | Changes per call. E.g.: 500 |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/changes?dataset=D116&place=XA-NO"Service
GET/statusService statusPublic
Status of each component, 30-day availability and incidents with their updates. Public.
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/status"GET/healthHealth checkPublic
Returns 200 if the API and the database respond. For external monitors. Public.
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/health"Places
GET/placesSearch placesQuery data
Finds place codes by name.
| Parameter | En | Type | Descripción |
|---|---|---|---|
q required | consultation | string | Name or code. E.g.: Acme |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/places?q=Acme"GET/places/locateLocate a pointQuery data
Most specific place (with loaded boundaries) containing some coordinates, and the places that contain it.
| Parameter | En | Type | Descripción |
|---|---|---|---|
lat required | consultation | number | Latitude. E.g.: 12.3456 |
lon required | consultation | number | Longitude. E.g.: -45.6789 |
country required | consultation | string | Country (2-letter ISO). E.g.: XA |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/places/locate?lat=12.3456&lon=-45.6789&country=XA"GET/places/{code}/geometryBoundaries of a placeQuery data
Simplified GeoJSON of the place; with children=1 it includes the places it contains.
| Parameter | En | Type | Descripción |
|---|---|---|---|
code required | route | string | Place code. E.g.: XA-NO |
children | consultation | integer | 1 = include children. E.g.: 1 |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/places/XA-NO/geometry?children=1"GET/coverageCoverage of a datasetQuery data
Which places have data for a dataset and how fresh it is.
| Parameter | En | Type | Descripción |
|---|---|---|---|
dataset | consultation | string | Standard code. E.g.: D124 |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/coverage?dataset=D124"Index
GET/transparencyTransparency rankingPublic
Data transparency index by place, with its eight dimensions and the change versus the previous month. Public.
| Parameter | En | Type | Descripción |
|---|---|---|---|
level | consultation | string | country, state or city. E.g.: state |
country | consultation | string | One country only. E.g.: XA |
limit | consultation | integer | Up to 500. E.g.: 100 |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/transparency?level=state&country=XA"GET/transparency/{code}Index of a placePublic
Index, dimensions, ranking position, missing essentials and monthly trend. Public.
| Parameter | En | Type | Descripción |
|---|---|---|---|
code required | route | string | Place code. E.g.: XA-NO |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/transparency/XA-NO"GET/transparency/{code}/badge.svgIndex badgePublic
SVG image with the place's index, to put on the government's website. Public.
| Parameter | En | Type | Descripción |
|---|---|---|---|
code required | route | string | Place code. E.g.: XA-NO |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/transparency/XA-NO/badge.svg"Alerts
GET/alertsYour alertsAlerts
The token's active alerts.
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/alerts"POST/alertsCreate alertAlerts
Notifies by webhook or email when records matching the filters arrive.
curl -X POST -H "Authorization: Bearer $DATLASE_TOKEN" -H "Content-Type: application/json" \
-d '{"name":"Nuevos hechos de tránsito en Acme","dataset":"D087","filters":{"place":"XA-NO-ACME"},"channel":"webhook","target":"https://mi-sistema.example/avisos"}' \
"https://datlase.com/api/v1/alerts"DELETE/alerts/{id}Turn off alertAlerts
| Parameter | En | Type | Descripción |
|---|---|---|---|
id required | route | integer | Alert id. E.g.: 1 |
curl -X DELETE -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/alerts/1"Webhooks
GET/webhooksYour webhooksAlerts
The organization's subscriptions to changes in the data.
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/webhooks"POST/webhooksCreate webhookAlerts
Get a signed POST every time a dataset receives new records. Filter by datasets and places.
curl -X POST -H "Authorization: Bearer $DATLASE_TOKEN" -H "Content-Type: application/json" \
-d '{"url":"https://mi-sistema.example/datlase","datasets":"D087,D124","places":"XA-NO"}' \
"https://datlase.com/api/v1/webhooks"DELETE/webhooks/{id}Delete webhookAlerts
| Parameter | En | Type | Descripción |
|---|---|---|---|
id required | route | integer | Webhook id. E.g.: 1 |
curl -X DELETE -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/webhooks/1"Delivery (governments)
GET/templatesTemplatesPublic
Datasets a government or vendor can deliver and their templates.
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/templates"GET/templates/{id}Delivery schemaPublic
JSON schema with a dataset's fields and rules.
| Parameter | En | Type | Descripción |
|---|---|---|---|
id required | route | string | Standard code. E.g.: D124 |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/templates/D124"POST/datasets/{id}/recordsDeliver recordsDelivery token
With a delivery token (dlp_). JSON {"records":[…]} or CSV. mode=append or mode=replace; publish=0 leaves the delivery under review.
| Parameter | En | Type | Descripción |
|---|---|---|---|
id required | route | string | Standard code. E.g.: D124 |
curl -X POST -H "Authorization: Bearer $DATLASE_TOKEN" -H "Content-Type: application/json" \
-d '{"records":[{"permit_num":"PC-2025-00123","permit_type":"Construcción nueva","issued_date":"2025-03-20","address":"Av. Principal 123, Col. Centro"}],"mode":"append"}' \
"https://datlase.com/api/v1/datasets/D124/records"GET/submissions/{n}Status of a deliveryDelivery token
Valid rows, invalid rows and issues found.
| Parameter | En | Type | Descripción |
|---|---|---|---|
n required | route | integer | Delivery number. E.g.: 1 |
curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/submissions/1"SDKs
One file per language, with no external dependencies (in R use httr2 and jsonlite). They page through results on their own, retry when the per-minute limit is reached or the server fails, and include helpers to verify webhooks.
tabla = dl.analytics("XA", ["D087:count", "pop"], level="state", per_capita=True)
for lugar in tabla["data"]:
print(lugar["name"], lugar["values"]["D087:count"])
print("correlación:", tabla["correlation"])const t = await dl.analytics('XA', ['D087:count', 'pop'], { level: 'state', perCapita: true });
console.table(t.data.map(l => ({ lugar: l.name, valor: l.values['D087:count'] })));$t = $dl->analytics('XA', ['D087:count', 'pop'], ['level' => 'state', 'pc' => 1]);
foreach ($t['data'] as $l) echo $l['name'], ': ', $l['values']['D087:count'], PHP_EOL;tab <- dl_analytics(dl, "XA", c("D087:count", "pop"), level = "state", per_capita = TRUE)
attr(tab, "correlation")AI agents (MCP)
Connect any MCP-compatible assistant to https://datlase.com/mcp.php with your token. Query tools: list_datasets, query_dataset, search_permits, search_incidents, find_place, coverage, list_metrics, analyze and time_series. With a delivery token (dlp_…) the same server offers list_templates, get_template, submit_records and submission_status.
{
"mcpServers": {
"datlase": {
"type": "http",
"url": "https://datlase.com/mcp.php",
"headers": {
"Authorization": "Bearer dlk_\u2026"
}
}
}
}Webhooks
Create a webhook in your account or with POST /webhooks. Every time a dataset gets new records, Datlase sends a POST with the event dataset.updated: dataset, place, records written and the URL to fetch only what is new. It retries after 1 minute, 10 minutes and 1 hour; after 20 failures in a row the webhook is paused.
Verify the signature: X-Datlase-Signature = sha256= HMAC-SHA256 of timestamp + "." + cuerpo with your secret, where the timestamp comes in X-Datlase-Timestamp. Reject notices older than 5 minutes.
from datlase import Datlase
ok = Datlase.verify_webhook(SECRETO, request.headers["X-Datlase-Timestamp"],
request.get_data(), request.headers["X-Datlase-Signature"])$ok = Datlase\Client::verifyWebhook($secreto, $_SERVER['HTTP_X_DATLASE_TIMESTAMP'],
file_get_contents('php://input'), $_SERVER['HTTP_X_DATLASE_SIGNATURE']);const ok = await Datlase.verifyWebhook(secreto, req.headers['x-datlase-timestamp'], rawBody, req.headers['x-datlase-signature']);Parquet, changes and aggregation
For large loads: download a full dataset as Parquet (typed, compressed columns, ready for pandas, DuckDB, Spark or BigQuery), replicate only what changed with the change log and group millions of rows on the server with the motor columnar.
curl -H "Authorization: Bearer $DATLASE_TOKEN" -o permisos.parquet \
"https://datlase.com/api/v1/datasets/D124/export.parquet?place=XA-NO"
# Python
import pandas as pd
df = pd.read_parquet("permisos.parquet")import requests, time
since = 0 # guárdalo entre corridas
while True:
r = requests.get("https://datlase.com/api/v1/changes", params={"dataset": "D116", "since": since, "include": "record", "wait": 25},
headers={"Authorization": "Bearer dlk_…"}).json()
for c in r["changes"]:
aplicar(c["op"], c["key"], c.get("record")) # insert, update o delete
since = r["next_since"]curl -H "Authorization: Bearer $DATLASE_TOKEN" \
"https://datlase.com/api/v1/datasets/D124/aggregate?group=permit_class&metric=sum&of=valuation&place=XA-NO"
# {"rows": [{"key": ["commercial"], "value": 1283997000, "records": 1600}, …],
# "stats": {"rows_scanned": 4001, "segments_skipped": 0, "ms": 1.4}}JSON schemas, CSV templates and each dataset's specification are published, versioned and signed, at datlase.org.
Deletes are detected on every full read of the source; a read that brings less than half of what was there deletes nothing. The webhook records.changed announces every load with changes and includes the URL to follow them. Service status is at GET /status and on the status page.
Data delivery (governments and vendors)
A government or the vendor it hires publishes directly to Datlase with its delivery token dlp_…. Check the dataset template, deliver JSON or CSV and review the result: valid rows, invalid rows and each issue with its row and field.
curl -X POST -H "Authorization: Bearer $DLP_TOKEN" -H "Content-Type: text/csv" \
--data-binary @permisos.csv "https://datlase.com/api/v1/datasets/D124/records?mode=append"dl = Datlase("dlp_…", base_url="https://datlase.com/api/v1")
res = dl.submit("D124", registros) # en bloques de 5,000
print(res[0]["rows_valid"], res[0]["rows_invalid"])Errors and limits
| Code | Meaning |
|---|---|
400 | A parameter is not valid; the message says which one. |
401 | The token is missing, does not exist or has expired. |
402 | Commercial use without a paid plan, or the trial ended. |
403 | The token lacks the permission or a restriction does not allow it (IP, country or dataset). |
429 | The per-minute limit was reached (wait what Retry-After) or the daily record limit. |
5xx | Our fault; retry with increasing backoff. |
| Plan | Calls per minute | Records per page | Records per day |
|---|---|---|---|
| Free | 30 | 100 | 5,000 |
| Pro | 300 | 1,000 | 500,000 |
| Business | 1,200 | 5,000 | Unlimited |
| Government | 300 | 1,000 | Unlimited |