Skip to content
DataMint

API and MCP documentation

Read-only access to every published dataset, for scripts and AI agents. No account and no key. Machine-readable: OpenAPI description and llms.txt.

Quickstart

1. Find datasets
curl -X POST "https://datamint.cloud/v1/search" \
  -H "content-type: application/json" \
  -d '{"query": "banks in Bulgaria", "limit": 5}'
2. Look at one: schema, a preview, its versions
curl "https://datamint.cloud/v1/datasets/bg.finance.credit_institutions"
curl "https://datamint.cloud/v1/datasets/bg.finance.credit_institutions/schema"
curl "https://datamint.cloud/v1/datasets/bg.finance.credit_institutions/preview?limit=5"
3. Fetch the data: a filtered page, or the whole file
curl -X POST "https://datamint.cloud/v1/datasets/bg.finance.credit_institutions/query" \
  -H "content-type: application/json" \
  -d '{"filters": {"institution_type": "bank"}, "limit": 10}'

curl -L -O -J "https://datamint.cloud/v1/datasets/bg.finance.credit_institutions/download?format=csv"

Basics

  • Base address: https://datamint.cloud. All data endpoints are under /v1.
  • Answers are JSON in a { data, meta } envelope; meta carries the request id and, for a dataset, its version, schema version, source date and the attribution text to use.
  • Attribution: reuse of the data requires the attribution shown on each dataset.
  • Limits: 120 requests per minute per address; searches, filtered queries and large downloads count against 30 per minute. The RateLimit header shows where you stand; a refusal is HTTP 429.
  • Versions and caching: every dataset change creates a version. Addresses that name a version never change and may be cached forever; the current-version download carries an ETag, so send it back in If-None-Match and a 304 means nothing changed.
  • Archived versions: old versions are not kept forever. The current version, the newest two superseded versions and any version superseded in the last 30 days keep their records; the records of older ones are archived. Querying an archived version, or downloading one in full from a versioned dataset, answers HTTP 410 VERSION_ARCHIVED (a version that never existed is 404 VERSION_NOT_FOUND). The error's details name the current version and what still works: a snapshot version's stored download and a versioned dataset's delta files stay. GET /versions marks archived versions with archived and archived_at.
  • Maps: datasets that have coordinates accept a geographic filter in queries, a bounding box or a point and a radius in kilometres, and can be downloaded as GeoJSON. The filter shows in the dataset's schema.
  • Pagination: a query returns a page and a next_cursor; send it back to continue. A cursor stays on the version it started with.
  • Price: queries and downloads of priced datasets are paid per request in USDC; everything else is free (pricing, how to pay).

Endpoints

API version 0.1.0.

Discovery

GET/v1/openapi.json

This API described in OpenAPI 3.1.

Answers: 200 OpenAPI document

GET/v1/datasets

List published datasets.

Answers: 200 Datasets with their current version

POST/v1/search

Find datasets by keywords and structured filters. Deterministic keyword matching over dataset metadata; no language model is involved.

Parameters

Answers: 200 Matching datasets, best first; 400 Invalid request; 413 Body too large; 415 Body is not application/json; 429 Too many requests

GET/v1/datasets/{datasetId}

One dataset with its current version, licence and attribution.

Parameters

  • datasetId (path, string, required): A dataset id from the dataset list. The example is a real published dataset, for clients that need a concrete address to try.

Answers: 200 The dataset; 400 Invalid id; 404 Unknown dataset

GET/v1/datasets/{datasetId}/schema

JSON Schema of the dataset's records.

Parameters

  • datasetId (path, string, required): A dataset id from the dataset list. The example is a real published dataset, for clients that need a concrete address to try.

Answers: 200 The schema; 400 Invalid id; 404 Unknown dataset

GET/v1/datasets/{datasetId}/preview

The first records of the current version.

Parameters

  • datasetId (path, string, required): A dataset id from the dataset list. The example is a real published dataset, for clients that need a concrete address to try.
  • limit (query, integer): default 10; 1 to 25

Answers: 200 Sample records; 400 Invalid request; 404 Unknown dataset

GET/v1/datasets/{datasetId}/versions

Published versions, newest first, with change summaries.

Parameters

  • datasetId (path, string, required): A dataset id from the dataset list. The example is a real published dataset, for clients that need a concrete address to try.

Answers: 200 Versions; 400 Invalid id; 404 Unknown dataset

Query

POST/v1/datasets/{datasetId}/query

Filtered, paginated records. Only the filters listed by the schema endpoint exist; results come from one pinned version.

Parameters

  • datasetId (path, string, required): A dataset id from the dataset list. The example is a real published dataset, for clients that need a concrete address to try.
  • PAYMENT-SIGNATURE (header, string): The signed x402 payment, base64 encoded, sent when retrying a request that answered 402. Only needed for paid requests.
  • JSON request body: see the OpenAPI description for its fields.

Answers: 200 A page of records. `next_cursor` is null on the last page.; 400 Invalid filters, limit, cursor or body; 402 Payment required: the price and how to pay are in the PAYMENT-REQUIRED header; 404 Unknown dataset or version; 410 VERSION_ARCHIVED: the version existed but retention archived its records; the body names what is still available; 413 Body too large; 415 Body is not application/json; 422 The query is too broad to answer quickly: narrow it; 429 Too many queries

Downloads

GET/v1/datasets/{datasetId}/download

Download the current version (json or csv). Revalidate with the ETag.

Parameters

  • datasetId (path, string, required): A dataset id from the dataset list. The example is a real published dataset, for clients that need a concrete address to try.
  • format (query, string): one of json, csv, geojson; default json
  • PAYMENT-SIGNATURE (header, string): The signed x402 payment, base64 encoded, sent when retrying a request that answered 402. Only needed for paid requests.

Answers: 200 The export file; 304 Not modified; 400 Invalid request; 402 Payment required: the price and how to pay are in the PAYMENT-REQUIRED header; 404 Unknown dataset or format not available; 429 Too many requests, or too many downloads in progress from this address (TOO_MANY_DOWNLOADS; see Retry-After); 503 Export temporarily unavailable, or the service is serving its maximum number of downloads (DOWNLOADS_BUSY; see Retry-After)

GET/v1/datasets/{datasetId}/versions/{version}/delta

What one version changed (versioned datasets): added and changed records, then removals, as NDJSON. Lets a client follow the dataset without downloading it again.

Parameters

  • datasetId (path, string, required): A dataset id from the dataset list. The example is a real published dataset, for clients that need a concrete address to try.
  • version (path, string, required): fixed pattern
  • PAYMENT-SIGNATURE (header, string): The signed x402 payment, base64 encoded, sent when retrying a request that answered 402. Only needed for paid requests.

Answers: 200 The delta, one JSON object per line; 304 Not modified; 400 Invalid request; 402 Payment required: the price and how to pay are in the PAYMENT-REQUIRED header; 404 Unknown dataset or version, or the version has no delta file; 429 Too many requests, or too many downloads in progress from this address (TOO_MANY_DOWNLOADS; see Retry-After); 503 Delta temporarily unavailable, or the service is serving its maximum number of downloads (DOWNLOADS_BUSY; see Retry-After)

GET/v1/datasets/{datasetId}/versions/{version}/download

Download a specific version. The file never changes, so it is cacheable forever.

Parameters

  • datasetId (path, string, required): A dataset id from the dataset list. The example is a real published dataset, for clients that need a concrete address to try.
  • version (path, string, required): fixed pattern
  • format (query, string): one of json, csv, geojson; default json
  • PAYMENT-SIGNATURE (header, string): The signed x402 payment, base64 encoded, sent when retrying a request that answered 402. Only needed for paid requests.

Answers: 200 The export file; 304 Not modified; 400 Invalid request; 402 Payment required: the price and how to pay are in the PAYMENT-REQUIRED header; 404 Unknown dataset, version or format; 410 VERSION_ARCHIVED: a versioned dataset version whose records retention archived (a full download is streamed from them); its delta files and the current version are unaffected; 429 Too many requests, or too many downloads in progress from this address (TOO_MANY_DOWNLOADS; see Retry-After); 503 Export temporarily unavailable, or the service is serving its maximum number of downloads (DOWNLOADS_BUSY; see Retry-After)

Operations

GET/health

Liveness: the process is up.

Answers: 200 Alive

GET/ready

Readiness: the database answers.

Answers: 200 Ready; 503 Not ready

Paying for requests

Priced requests use the open x402 protocol: no account and no key, you pay each request in USDC from a wallet. Each dataset's price is in the access.payment field of GET /v1/datasets/{id}. These are the paid requests; everything else is free: the catalogue, search, dataset metadata, schema, versions and previews.

  • Record queries: POST /v1/datasets/{id}/query
  • Downloads: GET /v1/datasets/{id}/download and /versions/{version}/download
  • Change files: GET /v1/datasets/{id}/versions/{version}/delta

How a payment goes

  1. Send the request. If it is valid and has a price, the answer is 402 Payment Required with a PAYMENT-REQUIRED header: the price, the network, the USDC token and who to pay. A request that is wrong (an unknown dataset or filter, a bad body) is answered 400 or 404 and never charged.
  2. Sign a payment for exactly that, with your wallet, and send the same request again with the signed payment in a PAYMENT-SIGNATURE header.
  3. DataMint checks the payment, settles it, and only then sends the data. The answer has a PAYMENT-RESPONSE header with the receipt.

The official client library does all of this in one call:

TypeScript: pay automatically (npm i @x402/fetch @x402/evm viem)
import { wrapFetchWithPayment, x402Client } from '@x402/fetch';
import { ExactEvmScheme } from '@x402/evm/exact/client';
import { privateKeyToAccount } from 'viem/accounts';

// A wallet holding USDC on the network the dataset names. Keep the key out of the code.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const client = new x402Client().register('eip155:*', new ExactEvmScheme(account));
const payingFetch = wrapFetchWithPayment(fetch, client);

const response = await payingFetch('https://datamint.cloud/v1/datasets/<dataset id>/query', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ limit: 25 }),
});
const { data } = await response.json();
curl: see the price (a 402 costs nothing)
curl -si -X POST https://datamint.cloud/v1/datasets/<dataset id>/query \
  -H 'content-type: application/json' -d '{"limit": 25}'
# HTTP/2 402
# payment-required: <base64: price, network, token, who to pay>

Rules worth knowing

  • One payment, one request. The same payment fetches the same request again for 24 hours at no charge. For a different request it is refused with HTTP 409 PAYMENT_PROOF_REUSED.
  • Failed payments. If the payment cannot be settled the answer is 402 PAYMENT_FAILED and nothing is sent. If it is taken and the request then fails (for example a query that is too broad), it is not refunded automatically.
  • Outages. 503 PAYMENT_UNAVAILABLE or PAYMENT_PENDING means the payment service did not answer; nothing is served without payment, and Retry-After says when to try again. PAYMENTS_PAUSED means a daily limit was reached.
  • Caches. Paid answers are marked private and are never to be stored by a shared cache.

Errors

An error is JSON: { "error": { "code", "message", "request_id" } }. Quote the request id when you ask about one.

  • INVALID_REQUEST
  • NOT_FOUND
  • DATASET_NOT_FOUND
  • VERSION_NOT_FOUND
  • VERSION_ARCHIVED
  • FORMAT_NOT_AVAILABLE
  • REQUEST_TOO_LARGE
  • UNSUPPORTED_MEDIA_TYPE
  • METHOD_NOT_ALLOWED
  • RATE_LIMITED
  • NOT_READY
  • EXPORT_UNAVAILABLE
  • TOO_MANY_DOWNLOADS
  • DOWNLOADS_BUSY
  • DB_BUSY
  • QUERY_TOO_BROAD
  • INTERNAL
  • PAYMENT_REQUIRED
  • PAYMENT_PROOF_REUSED
  • PAYMENT_FAILED
  • PAYMENT_EXPIRED
  • PAYMENT_PENDING
  • PAYMENT_UNAVAILABLE
  • PAYMENTS_PAUSED

MCP

AI agents can use DataMint as an MCP server at https://datamint.cloud/mcp: seven read-only tools to discover datasets, read their schema, preview, query and download. No account and no key. Client configuration, the tools, limits and how paid datasets are reported are on the MCP page.