Welcome to the the City of Oklahoma City Open Data Portal developers API page. This page shows the available developer endpoints for consuming data directly from this portal. With these endpoints, you can include our data on your own maps or with in your own applications.
If you prefer to simply embed our data, please see the Embed tab within our Data Viewer for the dataset of interest.
Click here to see all of the available dataset in our Data Catalog.
Provides access to data record information in either XML or JSON format. If no dataset (id) is provided, an array of available datasets is returned. This API supports both HTTP Get and Post methods.
HTTP Get provides simple record access of entire dataset or a single record.
HTTP Post supports all of HTTP Get options and also provides additional query options for sorting, attribute queries, and spatial queries. When using HTTP Post the request body should be submitted as a JSON object, with the content-type header set to text/json.
Syntax: |
https://data.okc.gov/services/portal/api/data/records/[ID] | ? | [option1=value] |
& | [option2=value] | ||
... | |||
& | [optionN=value] |
Option |
Method |
Values |
Default |
Required |
Notes |
ID | get | string | optional | Name of dataset to return records for. | |
recordID | get | integer | -1 | optional | When set, returns a single dataset record. Record ID is equivalent to the Object_ID field. For all records, set RecordID = -1. |
schemaOnly | get | true false |
false | optional | When set to true, only dataset schema information is returned. |
orderByField | post | string | optional | Name of field to sort results by. | |
ascending | post | true false |
true | optional | Use in conjunction with the OrderByField option to specify sort direction. |
spatialFilter | post | string | optional | Spatial filter (intersection) to apply to dataset. Geometry should be supplied as OGC Well Known Text (WKT). | |
bufferDistance | post | floag | 0 | optional | Use in conjunction with the SpatialFilter option to buffer supplied geometry prior to dataset comparison. Buffer distance should be supplied in feet. |
filterField | post | string | optional | Name of field to apply an attribute filter. | |
fitlerType | post | equal notequal like notlike in notin |
equal | optional | Use in conjunction with FilterField to specify the type of attribute comparison to use. |
filterValue | post | string | optional | Use in conjunction with FilterField and FilterType to specify a value or array of values (in or notin) for an attribute filter. |
Examples (HTTP POST) |
https://data.okc.gov/services/portal/api/data/records/schools |
|
https://data.okc.gov/services/portal/api/data/records/schools |
|
https://data.okc.gov/services/portal/api/data/records/schools |
|
https://data.okc.gov/services/portal/api/data/records/schools |
|
https://data.okc.gov/services/portal/api/data/records/schools |
|
Provides access to data optimized for displaying on maps in either XML or JSON format. Spatial information is returned in decimal degrees. This API supports HTTP Get method only.
Syntax: |
https://data.okc.gov/services/portal/api/map/layers/[ID] | ? | [option1=value] |
& | [option2=value] | ||
... | |||
& | [optionN=value] |
Option |
Method |
Values |
Default |
Required |
Notes |
ID | get | string | optional | Name of map (dataset) to return records for. | |
minLatitude | get | float | 33 | optional | Minimum latitude of result extent. |
maxLatitude | get | float | 33 | optional | Maximum latitude of result extent. |
minLongitude | get | float | 33 | optional | Minimum longitude of result extent. |
maxLongitude | get | float | 33 | optional | Minimum longitude of result extent. |
filterField | get | string | optional | Name of field to apply an attribute filter. | |
fitlerType | get | equal notequal like notlike in notin |
equal | optional | Use in conjunction with FilterField to specify the type of attribute comparison to use. |
filterValue | get | string | optional | Use in conjunction with FilterField and FilterType to specify a value or array of values (in or notin) for an attribute filter. |