Comment on page
Data Sources database
Use the API to find, use, and manage Data Sources.
https://data-sources.pdap.io
get
[base-url]
/search-tokens/{search}/{location}
Generate API token for front end search
The search tokens endpoint is located in resources/SearchTokens.py. The search tokens endpoint generates an API token valid for 5 minutes and forwards the search parameters to the Quick Search endpoint. This endpoint is meant for use by the front end only.
Parameters
Path
endpoint
The endpoint that will be accessed after a search token is generated
arg1*
String
The first argument that will be forwarded on to the appropriate endpoint. Currently either "search" for quick-search or "id" for data-sources
arg2*
String
The second argument that will be forwarded on to the appropriate endpoint. Currently just used for "location" for quick-search
Responses
200: OK
Successful operation
get
[base-url]
/quick-search/{search}/{location}
Quick Search Data Sources by search term and location
The quick search endpoint is located in resources/QuickSearch.py. The quick search endpoint executes its search using the agency_source_link table in the Data Sources database, which links each data source in the data_sources table with its associated agency in the agencies table. This endpoint is meant for use by the search tokens endpoint only.
Parameters
Path
search*
String
Checks partial matches on any of the following properties on the data_source table: "name", "description", "record_type", and "tags". The search term will is case insensitive and will match singular and pluralized versions of the term.
location*
String
Checks partial matches on any of the following properties on the agencies table: "county_name", "state_iso", "municipality", "agency_type", "jurisdiction_type", "name"
Header
Authorization*
Value formatted as "Bearer [access token/api key]”
Responses
200: OK
Successful operation
400: Bad Request
No API key found
403: Forbidden
Invalid API key
500: Internal Server Error
Something went wrong
get
[base-url]
/data-sources
Get all Data Sources
The data sources endpoint is located in resources/DataSources.py. The data sources endpoint returns all rows in the corresponding Data Sources database table.
Parameters
Header
Authorization*
Value formatted as "Bearer [access token/api key]”
Responses
200: OK
Successful operation
400: Bad Request
No API key found
403: Forbidden
Invalid API key
get
[base-url]
/data-sources/id
Get Data Source by Id
The data sources endpoint is located in resources/DataSources.py. The data source by id endpoint returns just the row for the data source that corresponds to the id passed.
Parameters
Header
Authorization*
Value formatted as "Bearer [access token/api key]”
Responses
200: OK
Successful operation
400: Bad Request
No API key found
403: Forbidden
Invalid API key
get
[base-url]
/agencies/{page}
Get all Agencies
The agencies endpoint is located in resources/Agencies.py. The agencies endpoint returns 1000 rows from the corresponding Data Sources database table offset by the page number passed.
Parameters
Path
page*
Passing 1 will return the first 1000 rows. Subsequent page number return subsequent results
Header
Authorization
Value formatted as "Bearer [access token/api key]”
Responses
200: OK
Successful operation
400: Bad Request
No API key found
403: Forbidden
Invalid API key
Last modified 16d ago