California Open Data

API to query public datasets made available by the state of California.

This is the Docfix sample API portal. The following guides are built on top of data.ca.gov.

California Open Data

California uses over 4000 datasets for initiatives involving public safety, public health, and environmental planning to name a few.

You can access this data at data.ca.gov/dataset.

Access the Data via API

This data is published as a CKAN dataset and can be accessed through multiple mechanisms, including the API and CSV export via web browser.

This documentation focuses on accessing the data through the API endpoint.

Find your Dataset

All datasets are located at data.ca.gov/dataset. Once you have located the dataset which you want to access, it is important to copy the resource ID.

An example is the "Surface Water - Fecal Indicator Bacteria Monitoring Results" dataset. This data takes biologic water quality samples around the state, and reports findings in the database table. The resource ID for this dataset is 15a63495-8d9f-4a49-b43a-3092ef3106b9.

Filter your Request

There are several parameters available that can filter your return values. One of note is simply q for query. This parameter is a generic full-text search query applied across all searchable fields.

If interfacing with the "Surface Water - Fecal Indicator Bacteria Monitoring Results" dataset, q = Coliform narrows the return to rows with the value "Coliform" for the "Analyte" column. This is flexible, and will pick up substrings.

Interpret the Data

The tabular structure changes according to the dataset, and it is important to understand that format to ease downstream analysis.

Every dataset will return a results that includes fields. The fields array of objects will contain the table columns that are unique to the dataset you are analyzing.