An package for the TBA api that pulls only FRC data (WIP)
npm install frctbaapi
import { FUNCTIONS YOU WANT TO IMPORT } from "frctbaapi";
Example:
import { TBAaddToken, teamInfo, teamRobotImage } from "frctbaapi";
Set token:
TBAaddToken(<token>)
Input:
teamInfo(team)
Output:
{
"key": "string",
"team_number": 0,
"nickname": "string",
"name": "string",
"school_name": "string",
"city": "string",
"state_prov": "string",
"country": "string",
"address": "string",
"postal_code": "string",
"gmaps_place_id": "string",
"gmaps_url": "string",
"lat": 0,
"lng": 0,
"location_name": "string",
"website": "string",
"rookie_year": 0,
"motto": "string",
"home_championship": {}
}
Input:
teamLogo(team)
Output:
URL or base64
Input:
teamRobotImage(team, year)
Output:
URL
Input:
teamAwards(team, year)
Output:
[
{
"name": "string",
"award_type": 0,
"event_key": "string",
"recipient_list": [
{
"team_key": "string",
"awardee": "string"
}
],
"year": 0
}
]
Input:
matchInfo(matchkey)
Output:
{
"key": "string",
"comp_level": "qm",
"set_number": 0,
"match_number": 0,
"alliances": {
"red": {
"score": 0,
"team_keys": [
"string"
],
"surrogate_team_keys": [
"string"
],
"dq_team_keys": [
"string"
]
},
"blue": {
"score": 0,
"team_keys": [
"string"
],
"surrogate_team_keys": [
"string"
],
"dq_team_keys": [
"string"
]
}
},
"winning_alliance": "red",
"event_key": "string",
"time": 0,
"actual_time": 0,
"predicted_time": 0,
"post_result_time": 0,
"score_breakdown": {},
"videos": [
{
"type": "string",
"key": "string"
}
]
}
Input:
eventInfo(eventkey)
Output:
{
"key": "string",
"name": "string",
"event_code": "string",
"event_type": 0,
"district": {
"abbreviation": "string",
"display_name": "string",
"key": "string",
"year": 0
},
"city": "string",
"state_prov": "string",
"country": "string",
"start_date": "2024-04-30",
"end_date": "2024-04-30",
"year": 0,
"short_name": "string",
"event_type_string": "string",
"week": 0,
"address": "string",
"postal_code": "string",
"gmaps_place_id": "string",
"gmaps_url": "string",
"lat": 0,
"lng": 0,
"location_name": "string",
"timezone": "string",
"website": "string",
"first_event_id": "string",
"first_event_code": "string",
"webcasts": [
{
"type": "youtube",
"channel": "string",
"date": "string",
"file": "string"
}
],
"division_keys": [
"string"
],
"parent_event_key": "string",
"playoff_type": 0,
"playoff_type_string": "string"
}
Input:
getTeamMedia(team, year)
Output:
[
{
"type": "youtube",
"foreign_key": "string",
"details": {},
"preferred": true,
"direct_url": "string",
"view_url": "string"
}
]
Input:
getRobots(team) Or getRobots(team, year)
Output:
Without year:
[
{
"year": 0,
"robot_name": "string",
"key": "string",
"team_key": "string"
}
]
With year:
{
"year": 0,
"robot_name": "string",
"key": "string",
"team_key": "string"
}