@section('page_title') OSAA - API Documentation @stop @section('page_sub_title') OSAA Application Programming Interface @stop @section('scripts') @parent @stop @section('jquery_init') @stop @section('page_functions') @stop @section('main_content')
The OSAA provides an application programming interface (API) to access database information. The basic premise is that data should be shared. The OSAA collects a vast amount of information from member schools that third parties find interesting. This data include schedules, scores, teams, rankings, and other information. This API provides a programmatic approach to accessing raw data.
This service is provided "as is" and the OSAA disclaims all warranties with regard to this service including all implied warranties of merchantability and fitness. In no event shall the OSAA be liable for any special, direct, indirect, or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortuous action, arising out of or in connection with the use or performance of this service.
The OSAA reserves the right to create, remove, update, and delete any component or module of this service at any time without prior notice.
Access is restricted to registered IP addresses or requests with an authenticated API access key. To acquire access, please contact Gibby Reynolds, OSAA IT Systems Administrator, (503) 682.6722 x228, {{ Helpers::obfuscateEmailLink ("gibbyr@osaa.org") }}.
All documentation relating to using the API can be found on this page. This page includes detailed instructions as well as examples for use. Technical support and questions can be directed toward Gibby Reynolds, OSAA IT Systems Administrator, (503) 682.6722 x228, {{ Helpers::obfuscateEmailLink ("gibbyr@osaa.org") }}.
Questions regarding integration or data usage are not supported by the OSAA. Comments regarding inaccurate schedules or contest scores or requests to change or update information relating to schedules and scores should be referred to the schools' athletic directors.
This API can only be used to access information via HTTP GET method requests. All other HTTP methods are denied. The OSAA intends to protect its database and vet individuals entering information by restricting editing privilege to authenticated users. This API cannot be used to insert records or modify data contained within the OSAA database; the API only allows data reads.
Data regarding schedules, scores, and teams only pertain to team sports (football, volleyball, soccer, basketball, baseball, and softball.) Individual sports and activities are not supported through this API.
This API returns all data in JSON format. JSON data can be viewed in a browser or in most HTTP response capturing programs. Regardless of the existence of an HTTP accept header, data will only be returned as "application/json". Some data fields may contain comma separated lists (CSL) as a string data-type.
All responses will be returned as a JSON array, even API requests for single data elements (as an array with one item). A custom HTTP response header is added to each return, named Content-Count, that contains the number of returned items in the array. In the event of an error, the value will be zero.
Data specifications for a particular node are included in the "Nodes" section. In the node list, the conceptual data element is explained with URL accessors for requesting related node information. Underneath the URL access handles, the item's return variables are listed with the name of the field, its data-type, and a brief explanation of that field. An example of accessing that node's handle is contained in the gray box showing the handle, returned JSON data, and the HTTP response headers.
The accuracy of information from the database is not guaranteed. Schools are responsible for inputing schedules before the first allowable contest date, updating their schedules, and inputting scores in a timely fashion. Data may also be cached for a period of time to help reduce server load and database hits.
The following terms are used in throughout this API documentation. This vocabulary is used by the OSAA and is provided for reference.
time_zones value by slug. Time zones do not factor in daylight savings time. In such cases, those different time zones should be calculated with their respective offset relative to Pacific Time. For example, a contest with a start_at value of "2014-05-15 13:00:00" and a time_zone of "MT", then the contest starts at 2:00pm Mountain Time, but is saved in the database as 1:00pm Pacific Time. Contest times that are at midnight ("00:00:00") should be handled as TBD.Some API requests requires access to past information or a specific subset of a node's collection. Common filter parameters can be appended to the end of a node's handle as a query string.
level=[V|JV|JV2|FR|FR2]year=[YYYY]since=[YYYY-MM-DD|YYYY-MM-DD HH:MM:SS]staff=[1]school_staff and team_staff object properties.
spread=[1]The API allows access to data relating to the nodes including Activities, Schools, Teams, Schedules, Contests, Leagues, OSAAtoday, and News Feeds. Details on accessing the API handles for each available node is described below. (Note: all information returned will be in a JSON array.)
yearhttp://www.osaa.org/api/activitieshttp://www.osaa.org/api/activities/{slug}| id | integer | Unique identification number |
| slug | string | A unique, three character abbreviation |
| name | string | Name of the activity |
| divisions | array | JSON array of strings of the sanctioned divisions |
| year | integer | The school year for which this information applies |
year, staffhttp://www.osaa.org/api/schoolshttp://www.osaa.org/api/schools/{slug}http://www.osaa.org/api/schools/{id}| id | integer | Unique identification number |
| name | string | Full name of the school |
| short_name | string | Shortened name of the school with common words removed or abbreviated |
| classification | string | School's classification |
| league | string | School's regularly assigned league |
| league_full_name | string | The name of the school's regularly assigned league including the league slug |
| league_name | string | The name of the school's regularly assigned league without the league slug |
| mascot | object | JSON object of school's mascot(s) containing (main, alternate, url) strings |
| colors | array | JSON array of the school's colors (up to three) containing JSON objects with (name, hex) strings |
| adm | integer | ADM, or enrollment, number of students for this school reported for the school year |
| year | integer | The school year for which this information applies |
| activities | object | *JSON object, associative array indexed by activity slug with values of JSON objects with (activity_name, activity_sport, activity_program_id, activity_program_name, division, league, league_full_name, league_name, and teams) |
| social_media | object | JSON array of the school's social media handles containing JSON objects with (platform, handle, link) strings |
| school_staff | object | **JSON object, associative array of administrative school staff containing JSON objects with (name, email, phone) strings - requires staff optional parameter to be provided |
| team_staff | object | ***JSON object, associative array of activity program head coaches containing JSON objects with (name, email, phone) strings - requires staff optional parameter to be provided |
activities associate array lists every OSAA sanctioned activity that this school offers within the specified school year. Index keys of the array are the 3-character activity slug. Values of the array are JSON objects containing the following fields:
| activity_name | string | The name of the activity offered |
| activity_sport | string | The name of the activity's sport (i.e. "Swimming" is the sport for activities named "Boys Swimming" and "Girls Swimming") |
| activity_program_id | integer | The unique ID number of this school's activity program. An activity program is a record identifying which activities are offered by which schools and in which school year. On the OSAA website, team pages default to the highest level of team and are indexed by activity program ID (i.e. http://www.osaa.org/teams/24225 lists Glencoe's 2018 Volleyball program and shows V, JV, JV2, and F teams) |
| activity_program_name | string | This is the name of the activity program. This name is usually the school's short_name, however, if the activity program is a coop program, then the activity_program_name will be a combination of all involved schools' short_name separated by a "/" |
| division | string | The classification of division (combined classifications) in which this activity program and its teams operate |
| league | string | The league slug in which this activity program and its teams have been assigned for this activity |
| league_full_name | string | The name of the program's assigned league including the league slug |
| league_name | string | The name of program's assigned league without the league slug |
| teams | array | JSON array representing all of the team levels offered by this school for this activity, (id, level) |
staff optional parameter is provided with some value. Administrative staff information is provided by the school. The school_staff object is an associative array, returned as a JSON object. Staff are returned as objects with each array index/object property corresponding to the respective role/title as follows:
staff optional parameter is provided with some value. Team staff information is provided by the school. The team_staff object is an associative array, returned as a JSON object. Only the team's first varsity level head coach will be displayed, if any. Staff are returned as objects with each array index/object property corresponding to the respective activity program slug. All activity programs the school offers/participates in the year will be listed.
name, email, and phone. Names are returned in "First Last" format. Email addresses, if provided and publicly available, will be listed; otherwise, null is returned. Phone numbers, if provided for office/work and are publicly available will be listed in "(####) ###-#### x#####" format; otherwise, null is returned.
level, yearhttp://www.osaa.org/api/teamshttp://www.osaa.org/api/teams/{id}http://www.osaa.org/api/teams/{activity}http://www.osaa.org/api/teams/{school}http://www.osaa.org/api/teams/{school}/{activity}| id | integer | Unique identification number |
| activity_program_id | integer | Unique identification number for the team's activity program |
| school | integer | Unique identification number of the team's host school |
| name | string | Name (school or coop name) |
| level | string | Competition level |
| activity | string | Sport |
| division | string | Division in which this team competes |
| league | string | League this team is assigned to, if any |
| league_full_name | string | League this team is assigned to, if any, with its full names including league slug |
| league_name | string | League this team is assigned to, if any, with just the name of the league |
| year | integer | The school year for which this information applies |
| social_media | object | JSON array of the team specific social media handles containing JSON objects with (platform, handle, link) strings. If no team specific media handles are specified, then the school's social media handles are displayed, if any. |
| overall_record | string | Record of all contests won, lost, and/or tied; wins-losses-ties |
| league_record | string | Record of league contests won, lost, and/or tied; wins-losses-ties |
| league_finish | integer | Final league placement, if any |
| osaa_rank | integer | *Team's OSAA ranking compared to other teams in the division |
| apr | integer | *Adjusted playoff ranking, if any |
| rpi_rank | integer | *Team's RPI ranking compared to other teams' RPI values in the division |
| rpi | float | *Rating percentage index; range [0, 1] |
| wwp | float | *Weighted winning percentage; range [0, 1] |
| owp | float | *Opponents' winning percentage; range [0, 1] |
| colley_rank | integer | *Team's Colley ranking compared to other teams' Colley values in the division |
| colley | float | *Colley rating |
| roster | array | **JSON array of the roster of players containing JSON objects |
| photo_url | string | Full URL path to the team photo, if any |
| updated_at | string | Date/time of when the team's information was last updated |
| calculated_at | string | Date/time of when the team's ranking specific information was last calculated |
http://www.osaa.org/api/schedules/{id}DEL. Deleted contests should be treated as non-existent as they are not recoverable (i.e. once a contest is deleted, it will not be reinstated.)
level, year, sincehttp://www.osaa.org/api/contests/{id}http://www.osaa.org/api/contests/{activity}http://www.osaa.org/api/contests/{activity}/{date}http://www.osaa.org/api/contests/{date}| id | integer | Unique identification number |
| year | integer | The school year for which this information applies |
| activity | string | Sport |
| type | string | *Type of the activity |
| division | string | Division, highest division if teams compete at different divisions |
| is_cross_division | boolean | True if the teams compete at different divisions, false if teams are in the same division |
| level | string | Competition level, highest level if teams compete at different levels |
| is_cross_level | boolean | True if the teams compete at different levels, false if teams are in the same level |
| league | string | League slug, if this contest is a league contest |
| is_scoreable | boolean | True if this contest will yield a score, false if the contest does not allow a score to be entered |
| status | string | **Scheduling status of the event |
| time_zone | string | Time zone slug |
| start_at | string | Date/time of when the contest starts |
| postpone_at | string | Date/time of when the contest is postponed to |
| location | string | Alternate contest location, if any; if none, contest is held at home team's school |
| is_neutral | boolean | True if the contest's location is a neutral site, false otherwise; used in rankings calculations |
| is_tournament | boolean | True if the contest is part of a tournament, false otherwise |
| tournament | string | Name of the tournament, if any |
| is_endowment | boolean | True if the contest is an endowment game, false otherwise |
| home | object | ***JSON object of the home team, contains (id, school_id) integer, (name, score, sub_scores) strings, (is_win, is_tie, is_forfeit, is_recordable, is_league_recordable, is_rankable) booleans, and (weight, points) floats |
| away | object | ***JSON object of the away team, contains (id, school_id) integer, (name, score, sub_scores) strings, (is_win, is_tie, is_forfeit, is_recordable, is_league_recordable, is_rankable) booleans, and (weight, points) floats |
| is_forfeit | integer | ****If not null, this contest was forfeited by the losing team (in which case refer to the contest's comments for more information) |
| is_swap_designation | boolean | True if teams swapped designation; i.e. home team bats first, false otherwise; used in rankings calculations for baseball and softball contests only |
| oos_record | string | Out-of-state opponent's record, if any, in W-L or W-L-T format |
| oos_updated_at | string | Date/time of when the out-of-state opponent's record information was last updated, if applicable |
| comments | string | Comments or notes about this contest, if any |
| overtime_notes | string | Details entered if the contest went into overtime, extra innings, or extra sets |
| updated_at | string | Date/time of when the contest's information was last updated |
| created_at | string | Date/time of when this contest was created |
is_forfeit. If the contest is over, then the losing team will have an indicator flag, also named is_forfeit which can be treated as a boolean to determine which team forfeited. The contest's is_forfeit value represents what type of forfeit if the contest was forfeited by a team. If the value is null, then the contest was not a forfeit. The contest type determines if the contest is included in the rankings or not based off of rankings policies. The following forfeit types correspond to their ID number: