Overview

The District of Columbia Open Data API gives you free access to hundreds of public datasets from the D.C. government, covering topics like crime statistics, GIS maps, and financial records. No API key is needed, making it a great starting point for beginners exploring real government data. You can use it to build data visualizations, research tools, or civic tech applications.

Beginner Tip

Start by browsing the open data portal at opendata.dc.gov to find datasets of interest before calling the API endpoints. Most datasets support JSON output which is easy to parse in any language.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

District of Columbia Open Data data via REST API

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "status": "success",
  "data": {
    "result": "Data from District of Columbia Open Data",
    "description": "Contains D.C. government public datasets, including crime, GIS, financial data, and so on",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

features Array of geographic feature objects, each containing attributes and geometry
attributes Key-value pairs of the dataset fields for each record, such as crime type, date, or location
geometry GIS coordinates (x, y or rings) representing the geographic location of the record
objectid Unique identifier for each record in the dataset
exceededTransferLimit True if more records exist beyond the current page; use resultOffset to fetch the next page

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://maps2.dcgis.dc.gov/dcgis/rest/services/FEEDS/MPD/MapServer/8/query?where=1%3D1&outFields=*&outSR=4326&f=json&resultRecordCount=5";
const response = await fetch(url);
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

Empty or null response The query filter may be too restrictive or the dataset endpoint has changed
Check the D.C. Open Data portal for updated endpoint URLs and test with where=1=1 to return all records
CORS error in browser Some D.C. GIS endpoints restrict cross-origin browser requests
Make requests from a backend server or Node.js script instead of directly from a browser
Slow response or timeout Requesting too many records at once from large datasets
Add resultRecordCount=100 and use pagination with resultOffset to page through large datasets

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth No Auth
HTTPS REQUIRED
CORS UNKNOWN
Category Government
Difficulty Beginner
Listing details not endpoint-verified

Similar APIs

View All →