API Documentation
Thanks for checking out our API. Below is the full documentation for requesting data from the API.
This API is fully versioned, meaning that if we add or change the way it works, those changes will occurr on different URLs. Anything built against this documentation will continue to work as outlined here.
Supported Formats
The API currently supports requests in the following formats:
- JSON
- XML
Response Format
For XML responses, the <stand> tag is the root of the document. For JSON responses, all methods accept an optional callback parameter for use in AJAX requests.
Each response has two main attributes: request and response.
request
The request attribute contains information about the calling request, such as method, items_per_page and any GET parameters
response
The response parameter contains the requested data as outlined below for each method.
Informational Methods
Options
- URL
- http://results.chattanoogastand.com/api/1/options.format
- Acceptable Parameters
- None
Returns a results parameter containing the code and display name for each of our demographic options. For instance:
{
'response': {
'results': {
'genders': {
0: 'did not specify',
1: 'male',
2: 'female'
}
}
}
}
Questions
- URL
- http://results.chattanoogastand.com/api/1/questions.format
- Acceptable Parameters
- None
Returns a list of our four questions.
Categories
- URL
- http://results.chattanoogastand.com/api/1/categories.format
- Acceptable Parameters
- None
Returns a list of the categories used to identify each response with the category's code number, name, and theme.
Themes
- URL
- http://results.chattanoogastand.com/api/1/themes.format
- Acceptable Parameters
- None
Returns a list of the category themes used to identify each response with the theme's code number and name.
ZIP Codes
- URL
- http://results.chattanoogastand.com/api/1/zip_codes.format
- Acceptable Parameters
- None
Returns a list of every ZIP code used in our survey.
Raw Responses
- URL
- http://results.chattanoogastand.com/api/1/responses.format
- Acceptable Parameters
-
- keywords
- zip_code
- theme
- sex (can be multiple IDs separated by commas)
- ethnicity (can be multiple IDs separated by commas)
- education (can be multiple IDs separated by commas)
- age (can be multiple IDs separated by commas)
- grade (can be multiple IDs separated by commas)
- page
- items_per_page (defaults to 20, maximum 100)
- category (can be multiple IDs separated by commas; will be ignored if "theme" is also specified)
Returns a paginated list of all responses filtered by any combination of the available parameters. Specifying no parameters will return a paginated list of all the responses.
Search
- URL
- http://results.chattanoogastand.com/api/1/search.format
- Acceptable Parameters
-
- keywords
- zip_code
- theme
- sex (can be multiple IDs separated by commas)
- ethnicity (can be multiple IDs separated by commas)
- education (can be multiple IDs separated by commas)
- age (can be multiple IDs separated by commas)
- grade (can be multiple IDs separated by commas)
- category (can be multiple IDs separated by commas; will be ignored if "theme" is also specified)
Returns the demographic data and category breakdown for all results matching the specfied parameters. Specifying no parameters returns the demographics for the entire response set.
By Question
Demographics
- URL
- http://results.chattanoogastand.com/api/1/questions/number.format
- Acceptable Parameters
- None
Returns the demographic data for the specified question along with a breakdown of the top categories used for the question's responses.
Responses
- URL
- http://results.chattanoogastand.com/api/1/questions/number/responses.format
- Acceptable Parameters
- page, items_per_page
Returns a paginated list of all responses for the specified question.
By Category
Demographics
- URL
- http://results.chattanoogastand.com/api/1/categories/number.format
- Acceptable Parameters
- None
Returns the demographic data for the specified category.
Responses
- URL
- http://results.chattanoogastand.com/api/1/categories/number/responses.format
- Acceptable Parameters
- page, items_per_page
Returns a paginated list of all responses for the specified category.
By Theme
Demographics
- URL
- http://results.chattanoogastand.com/api/1/themes/number.format
- Acceptable Parameters
- None
Returns the demographic data for the specified theme along with a breakdown of the top categories used for each questions' responses.
Responses
- URL
- http://results.chattanoogastand.com/api/1/themes/number/responses.format
- Acceptable Parameters
- page, items_per_page
Returns a paginated list of all responses for the specified theme.
By ZIP Code
Demographics
- URL
- http://results.chattanoogastand.com/api/1/zip_codes/number.format
- Acceptable Parameters
- None
Returns the demographic data for the specified ZIP code along with a breakdown of the top categories used for each questions' responses.
Responses
- URL
- http://results.chattanoogastand.com/api/1/zip_codes/number/responses.format
- Acceptable Parameters
- page, items_per_page
Returns a paginated list of all responses for the specified ZIP code.