ftc_api_v3_client

FtcApiV3Client - the Ruby gem for the FTC Scoring Data API

THIS API IS CURRENTLY IN EARLY DEVELOPMENT AND MAY CHANGE WITHOUT WARNING. THIS PAGE WILL BE UPDATED ONCE THE API IS OFFICIALLY RELEASED.

This API provides event and scoring data for FIRST Tech Challenge. Applications that present result data directly are encouraged to directly call this API rather than maintaining their own copies of the data. All endpoints are cached by our CDN and may return data up to one hour old for data that changes infrequently. During an event, data that changes frequently (e.g. match results and rankings) should not be more than 30 seconds old.

NOTE: For developers who have integrated with the v2 API in the past, this is a policy shift, as previously developers were encouraged to maintain their own copy of relevant data. In the interest of providing the community with the most up-to-date data and reducing the burden for applications that are not performing their own analytics on event data, we are now encouraging directly integrating our API into websites and apps.

Also note that all endpoints that accept a year argument now expect the year in which the FIRST Championship for that season is held. This is a change from the previous API and FTC-events website, which used the kickoff year.

To report any issues, please report an issue here: https://github.com/FIRST-Tech-Challenge/scorekeeper/issues/new?template=api-bug-report.md To request additional data, please submit a feature request here: https://github.com/FIRST-Tech-Challenge/scorekeeper/issues/new?template=api-feature-request.md

This SDK is automatically generated by the OpenAPI Generator project:

  • API version: v3
  • Package version: 0.1.2
  • Generator version: 7.20.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

To build the Ruby code into a gem:

gem build ftc_api_v3_client.gemspec

Then either install the gem locally:

gem install ./ftc_api_v3_client-0.1.2.gem

(for development, run gem install --dev ./ftc_api_v3_client-0.1.2.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'ftc_api_v3_client', '~> 0.1.2'

Install from Git

If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'ftc_api_v3_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'ftc_api_v3_client'

# Setup authorization
FtcApiV3Client.configure do |config|
  # Configure API key authorization: ApiKeyAuth
  config.api_key['api_key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  # config.api_key_prefix['api_key'] = 'Bearer'
end

api_instance = FtcApiV3Client::EventsApi.new
cmp_year = 'cmp_year_example' # String | The year of the FIRST Championship for the requested season
event_code = 'event_code_example' # String | The code (abbreviation) for the event

begin
  #Get event from season
  result = api_instance.get_event(cmp_year, event_code)
  p result
rescue FtcApiV3Client::ApiError => e
  puts "Exception when calling EventsApi->get_event: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://ftc-api.firstinspires.org

Class Method HTTP request Description
FtcApiV3Client::EventsApi get_event GET /api/v3/seasons/cmpYear/events/eventCode Get event from season
FtcApiV3Client::EventsApi get_event_advancement_from GET /api/v3/seasons/cmpYear/events/eventCode/advancement/from Get event advancement (from)
FtcApiV3Client::EventsApi get_event_alliance_selections GET /api/v3/seasons/cmpYear/events/eventCode/alliances/selections Get event alliance selections
FtcApiV3Client::EventsApi get_event_alliances GET /api/v3/seasons/cmpYear/events/eventCode/alliances Get event alliances
FtcApiV3Client::EventsApi get_event_awards GET /api/v3/seasons/cmpYear/events/eventCode/awards Get event awards
FtcApiV3Client::EventsApi get_event_match GET /api/v3/seasons/cmpYear/events/eventCode/matches/tournamentLevel/series/number Get match details
FtcApiV3Client::EventsApi get_event_pit_map GET /api/v3/seasons/cmpYear/events/eventCode/pitMap Get pit map
FtcApiV3Client::EventsApi get_event_playoff_rankings GET /api/v3/seasons/cmpYear/events/eventCode/playoffRankings Get event playoff rankings
FtcApiV3Client::EventsApi get_event_playoff_structure GET /api/v3/seasons/cmpYear/events/eventCode/playoffStructure Get playoff structure
FtcApiV3Client::EventsApi get_event_rankings GET /api/v3/seasons/cmpYear/events/eventCode/rankings Get event rankings
FtcApiV3Client::EventsApi list_event_matches GET /api/v3/seasons/cmpYear/events/eventCode/matches List event matches
FtcApiV3Client::EventsApi list_event_teams GET /api/v3/seasons/cmpYear/events/eventCode/teams List teams for an event
FtcApiV3Client::EventsApi list_events GET /api/v3/seasons/cmpYear/events List events for a season
FtcApiV3Client::LeaguesApi get_league GET /api/v3/seasons/cmpYear/regions/regionCode/leagues/leagueCode Gets a single league from a region
FtcApiV3Client::LeaguesApi get_league_rankings GET /api/v3/seasons/cmpYear/regions/regionCode/leagues/leagueCode/rankings Get rankings for a league
FtcApiV3Client::LeaguesApi list_league_events GET /api/v3/seasons/cmpYear/regions/regionCode/leagues/leagueCode/events List events for a league
FtcApiV3Client::LeaguesApi list_league_teams GET /api/v3/seasons/cmpYear/regions/regionCode/leagues/leagueCode/teams List teams for a league
FtcApiV3Client::LeaguesApi list_leagues GET /api/v3/seasons/cmpYear/regions/regionCode/leagues Lists leagues for a region
FtcApiV3Client::RegionsApi get_region GET /api/v3/seasons/cmpYear/regions/regionCode Get region from a season
FtcApiV3Client::RegionsApi list_region_events GET /api/v3/seasons/cmpYear/regions/regionCode/events List events for a regions
FtcApiV3Client::RegionsApi list_region_teams GET /api/v3/seasons/cmpYear/regions/regionCode/teams List teams for a region
FtcApiV3Client::RegionsApi list_regions GET /api/v3/seasons/cmpYear/regions List regions for a season
FtcApiV3Client::SeasonsApi get_season GET /api/v3/seasons/cmpYear Get single FTC season
FtcApiV3Client::SeasonsApi list_seasons GET /api/v3/seasons List all FTC seasons
FtcApiV3Client::TeamsApi get_team GET /api/v3/seasons/cmpYear/teams/number Get teams information
FtcApiV3Client::TeamsApi get_team_details GET /api/v3/seasons/cmpYear/teams/number/details Get detailed team information
FtcApiV3Client::TeamsApi get_team_history GET /api/v3/teams/number Get team history
FtcApiV3Client::TeamsApi list_team_avatars GET /api/v3/seasons/cmpYear/avatars List team avatars for a season
FtcApiV3Client::TeamsApi list_teams GET /api/v3/seasons/cmpYear/teams List teams for a season

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: api_key
  • Location: URL query string