Skip to content

Discover datasets

SODA API based portal

Use Socrata.discover to page through datasets:

from dotgov.socrata import Socrata, Only
from dotgov.constants import SEATTLE


with Socrata(domain=SEATTLE, version=3.0) as s:
    filters = {"only": Only.DATASET.value, "limit": 100}

    for ds in s.discover(filters=filters):
        print(ds["resource"]["name"])

Note

dotgov includes enums for Only, Provenance and ApprovalStatus, fields that can be used as filters in the Discover API.

The library also provides a DiscoverFilters Pydantic model that defines all filters that a user would be able to specify.

You can find more information about filters allowed on the Discovery API page.