Query the data.gov CKAN API to discover and access US federal open datasets

domain: catalog.data.gov · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Access the data.gov CKAN API at https://catalog.data.gov/api/3/ without authentication for most read operations; the API follows the CKAN API v3 specification
  2. Search for datasets using POST /action/package_search with a JSON body containing the q (full-text search query), fq (filter query using Solr syntax, e.g., fq=organization:irs-gov), rows, and start parameters for pagination
  3. Parse the result.results array in the response; each dataset record contains the name (URL slug), title, organization, resources (list of files with URL, format, and description), and tags fields
  4. Retrieve a specific dataset's full metadata using GET /action/package_show?id={dataset-name-or-id}; this returns all resource URLs, update frequency, license, publisher, and spatial/temporal coverage if available
  5. Download a dataset resource by following the URL in the resources[].url field; resources may be CSV, JSON, XML, Excel, shapefile, or API endpoints — check the format field before assuming the download format
  6. For datasets that provide an API resource rather than a file download, the resource URL may point to a Socrata, ArcGIS, or agency-specific API; use the resource description and format fields to identify the downstream API and consult its own documentation

Known gotchas

Related routes

Search and retrieve federal open-dataset metadata using the Data.gov CKAN API
catalog.data.gov · 5 steps · unrated
Discover and download datasets from data.gov using the CKAN API
data.gov · 5 steps · unrated
Search and harvest dataset metadata from data.gov using the CKAN API
catalog.data.gov · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans