API Documentation

How to access data through the City's APIs

  • Email Facebook Twitter Google+

The City of St. Louis provides an application programming interface (API) for developers to access some of the City's public data.

You need to request an API key before accessing the City's APIs.

Available APIs

CSB Service Requests

This API provides access to service request data submitted to the Citizens' Service Bureau. Uses the Open311 GeoReport v2 spec.

View the CSB API documentation.

Accessing API Methods

The City's APIs use a RESTful interface, which means that you can send an HTTP GET or POST to call the API's methods, which responds with a document and HTTP status code.

API Keys

You will need to have an API key for each of the APIs you would like to use. API keys need to be kept secret, much like a password.

If you would like an API key, send us a request and tell us how you would like to use the data.

If you forgot your API key, you can retrieve it using the email address on file.

Making API Calls

  • Each call needs to include your API key.
  • Each API call should be done using https.
  • Simply change the format extension for your request to get results in a different format. Check the documentation for supported formats for each API method.
Coldfusion: Make a CSB API call (8 lines)
1
2
3
4
5
6
7
8
<!--- Make a request for data in JSON format ---> 
<cfhttp 
	method="get" 
	url="https://www.stlouis-mo.gov/powernap/stlouis/api.cfm/requests/32345.json?api_key=YourKeyGoesHere"  
	result="objHTTP" /> 
 
<!--- View the results ---> 
<cfdump var="#objHTTP.filecontent.tostring()#" />
PHP: Make a CSB API call (8 lines)
1
2
3
4
5
6
7
8
// Set up the URL 
$url = "https://www.stlouis-mo.gov/powernap/stlouis/api.cfm/requests/32345.json?api_key=yourApiKeyHere"; 
 
// Get the results 
$response = file_get_contents($url); 
 
// Parse the JSON 
$requestInfo = json_decode($response, true);
Python: Make a CSB API call (8 lines)
1
2
3
4
5
6
7
8
# Import an HTTP library 
import requests 
 
# Make the request 
r = requests.get('https://www.stlouis-mo.gov/powernap/stlouis/api.cfm/requests/32345.json?api_key=yourApiKeyHere') 
 
# The returned data 
r.json()
Was this helpful?      
Comments are helpful!
500 character limit
Feedback is anonymous. If you would like a response, contact this department directly.