cfbd / cfb-api Goto Github PK
View Code? Open in Web Editor NEWCollege football API - Programming interface for accessing the college football database
License: MIT License
College football API - Programming interface for accessing the college football database
License: MIT License
The link at the bottom of the docs (https://api.collegefootballdata.com/api/docs/?url=/api-docs.json#/) indicates that the schema is invalid.
The provided validator output indicates two key issues:
/definitions/LivePlayByPlay/properties/drives/items
is incorrectThe first one is pretty straight forward. I dug into the second one, and it's actually in one of the nested objects.
I'll open a PR for these fixes.
invalid schema image/link
Error: "๐ฑ Could not render n, see the console."
{
"messages":
[
"attribute paths.'/games/media'(get).[week].minumum is unexpected",
"attribute paths.'/games/weather'(get).[week].minumum is unexpected",
"attribute paths.'/games/players'(get).[year].minumum is unexpected",
"attribute paths.'/games/players'(get).[week].minumum is unexpected",
"attribute paths.'/drives'(get).[week].minumum is unexpected",
"attribute paths.'/plays'(get).[week].minumum is unexpected",
"attribute paths.'/play/stats'(get).[week].minumum is unexpected",
"attribute paths.'/roster'(get).[year].minumum is unexpected",
"attribute paths.'/teams/matchup'(get).[minYear].minumum is unexpected",
"attribute paths.'/coaches'(get).[year].minumum is unexpected",
"attribute paths.'/rankings'(get).[week].minumum is unexpected",
"attribute paths.'/lines'(get).[week].minumum is unexpected",
"attribute paths.'/ppa/games'(get).[week].minumum is unexpected",
"attribute paths.'/ppa/players/games'(get).[week].minumum is unexpected",
"attribute paths.'/metrics/wp/pregame'(get).[week].minumum is unexpected",
"attribute paths.'/stats/season'(get).[startWeek].minumum is unexpected",
"attribute paths.'/stats/season'(get).[endWeek].minumum is unexpected",
"attribute paths.'/stats/season/advanced'(get).[startWeek].minumum is unexpected",
"attribute paths.'/stats/season/advanced'(get).[endWeek].minumum is unexpected",
"attribute paths.'/stats/game/advanced'(get).[week].minumum is unexpected"
],
"schemaValidationMessages":
[
{
"level": "error",
"domain": "validation",
"keyword": "anyOf",
"message": "instance failed to match at least one required schema among 2",
"schema":
{
"loadingURI": "http://swagger.io/v2/schema.json#",
"pointer": "/definitions/schema/properties/items"
},
"instance":
{
"pointer": "/definitions/LivePlayByPlay/properties/drives/items"
}
}
]
}
output from validator
When requesting advanced stats, the "conference" property always displays the current conference. The regular stats endpoint, however, returns the relevant conference for each stat.
Make a request for advanced stats for a team that has changed conferences, for example UCF.
year
parameter
curl \
--request GET 'https://api.collegefootballdata.com/stats/season/advanced?team=ucf' \
--header 'Authorization: Bearer $CFBD_API_TOKEN'
year
parameter
curl \
--request GET 'https://api.collegefootballdata.com/stats/season/advanced?team=ucf&year=2005' \
--header 'Authorization: Bearer $CFBD_API_TOKEN'
Inspect a stat for a year where they were in a different conference (e.g. 2005)
{
"season": 2005,
"team": "UCF",
"conference": "American Athletic",
...
}
The "conference" property is the conference affiliated with the team at the time of the stat (e.g. "Conference USA").
The "conference" property is always the current conference (e.g. "American Athletic").
The StatsService.getTeamStats
function builds the SQL that joins on the matching conference, which I think is desired:
INNER JOIN conference_team AS ct
ON t.id = ct.team_id
AND ct.start_year <= g.season
AND (ct.end_year IS NULL OR ct.end_year >= g.season)
The StatsService.getAdvancedStats
function builds the SQL using a couple different join conditions, but always on the latest conference:
INNER JOIN conference_team AS ct
ON t.id = ct.team_id
AND ct.end_year IS NULL
and...
INNER JOIN conference_team AS ct
ON ct.team_id = t.id
AND ct.end_year IS NULL
AND ct.start_year IS NOT NULL
Thoughts @BlueSCar ?
Hello!
I hope you are doing well!
We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.
Can you enable it, so that we can report it?
Thanks in advance!
PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.