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.

  1. Create your accountIt is free for non-commercial use.
  2. Create a tokenIn your account → Tokens; give it only the permissions it needs.
  3. 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"

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:

PermitWhat it allows
Query data readCatalog, records, places and coverage (API and MCP).
Alerts alertsAlerts and webhooks.
Analytics analyticsAnalytics engine: compare places, series and indicators.
Bulk downloads bulkBulk 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.

ParameterEnTypeDescripción
qconsultationstringText to search. E.g.: transit
countryconsultationstringCountry (2-letter ISO). E.g.: XA
placeconsultationstringPlace 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.

ParameterEnTypeDescripción
id requiredroutestringStandard 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.

ParameterEnTypeDescripción
countryconsultationstringOne 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.

ParameterEnTypeDescripción
countryconsultationstringOne 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.

ParameterEnTypeDescripción
id requiredroutestringStandard code. E.g.: D087
placeconsultationstringPlace code; includes everything under it. E.g.: XA-NO
fromconsultationstringFrom (YYYY-MM-DD). E.g.: 2025-01-01
toconsultationstringTo (YYYY-MM-DD).
qconsultationstringText.
since_ingestedconsultationstringOnly what was loaded after this date and time (UTC).
formatconsultationstringcsv = the same page in CSV (the next cursor comes in X-Next-Cursor).
limitconsultationintegerRecords per page (maximum depends on your plan). E.g.: 100
cursorconsultationstringValue 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.

ParameterEnTypeDescripción
id requiredroutestringStandard code. E.g.: D124
placeconsultationstringPlace code; includes everything under it. E.g.: XA-NO
maxconsultationintegerMaximum records. E.g.: 100000
cursorconsultationstringValue 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.

ParameterEnTypeDescripción
placeconsultationstringPlace code; includes everything under it. E.g.: XA-NO
fromconsultationstringIssued since. E.g.: 2025-01-01
classconsultationstringresidential, commercial, industrial, mixed, other
min_valueconsultationnumberMinimum value.
limitconsultationintegerRecords per page (maximum depends on your plan). E.g.: 100
cursorconsultationstringValue 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).

ParameterEnTypeDescripción
placeconsultationstringPlace code; includes everything under it. E.g.: XA-NO
fromconsultationstringFrom.
offenseconsultationstringOffense (text).
limitconsultationintegerRecords per page (maximum depends on your plan). E.g.: 100
cursorconsultationstringValue 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.

ParameterEnTypeDescripción
id requiredroutestringStandard code. E.g.: D124
groupconsultationstringColumns to group by, comma separated. E.g.: permit_class
metricconsultationstringcount, sum, avg, min, max or distinct. E.g.: sum
ofconsultationstringColumn to measure. E.g.: valuation
bucketconsultationstringFor dates: year, month or day.
where[]consultationstringFilter column:op:value (eq, ne, gt, gte, lt, lte, in, has). E.g.: work_type:eq:new
placeconsultationstringPlace code; includes everything under it. E.g.: XA-NO
limitconsultationintegerGroups 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.

ParameterEnTypeDescripción
id requiredroutestringStandard 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.

ParameterEnTypeDescripción
scope requiredconsultationstringPlace that contains the ones being compared. E.g.: XA
levelconsultationstringchildren, state or city. E.g.: state
metrics requiredconsultationstringComma-separated ids. E.g.: D087:count,pop
fromconsultationintegerStart year. E.g.: 2024
toconsultationintegerEnd year. E.g.: 2025
pcconsultationinteger1 = 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.

ParameterEnTypeDescripción
scope requiredconsultationstringPlace. E.g.: XA
metrics requiredconsultationstringAn indicator id. E.g.: D087:count
placesconsultationstringComma-separated codes. E.g.: XA-NO
grainconsultationstringmonth 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.

ParameterEnTypeDescripción
datasetconsultationstringStandard code. E.g.: D116
placeconsultationstringPlace code; includes everything under it. E.g.: XA-NO
sinceconsultationintegerSequence number to continue from. E.g.: 0
opconsultationstringinsert, update or delete.
includeconsultationstringrecord to include the record. E.g.: record
waitconsultationintegerSeconds to wait if there are no changes (maximum 25). E.g.: 0
limitconsultationintegerChanges 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.

ParameterEnTypeDescripción
q requiredconsultationstringName 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.

ParameterEnTypeDescripción
lat requiredconsultationnumberLatitude. E.g.: 12.3456
lon requiredconsultationnumberLongitude. E.g.: -45.6789
country requiredconsultationstringCountry (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.

ParameterEnTypeDescripción
code requiredroutestringPlace code. E.g.: XA-NO
childrenconsultationinteger1 = 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.

ParameterEnTypeDescripción
datasetconsultationstringStandard 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.

ParameterEnTypeDescripción
levelconsultationstringcountry, state or city. E.g.: state
countryconsultationstringOne country only. E.g.: XA
limitconsultationintegerUp 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.

ParameterEnTypeDescripción
code requiredroutestringPlace 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.

ParameterEnTypeDescripción
code requiredroutestringPlace 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
ParameterEnTypeDescripción
id requiredrouteintegerAlert 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
ParameterEnTypeDescripción
id requiredrouteintegerWebhook 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.

ParameterEnTypeDescripción
id requiredroutestringStandard 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.

ParameterEnTypeDescripción
id requiredroutestringStandard 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.

ParameterEnTypeDescripción
n requiredrouteintegerDelivery 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"])

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"])

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")

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"

Errors and limits

CodeMeaning
400A parameter is not valid; the message says which one.
401The token is missing, does not exist or has expired.
402Commercial use without a paid plan, or the trial ended.
403The token lacks the permission or a restriction does not allow it (IP, country or dataset).
429The per-minute limit was reached (wait what Retry-After) or the daily record limit.
5xxOur fault; retry with increasing backoff.
PlanCalls per minuteRecords per pageRecords per day
Free301005,000
Pro3001,000500,000
Business1,2005,000Unlimited
Government3001,000Unlimited