When I query the database for, say, Alonso’s all-time results, I use the following URL: http://ergast.com/api/f1/drivers/alonso/driverStandings
I get his 8 first seasons results, however, the 2010 season does not appear.
Is this intended, or is it a bug?
Which solution is best to get *all* results from up to today for a given driver? Should I add something like http://ergast.com/api/current/f1/drivers/alonso/driverStandings and check if there’s 0 or 1 result? At the end of the season, won’t I be counting the last results twice?
I’ve considered this issue in the past and neither of the two possible behaviours is ideal in all circumstances. The deciding factor for me was realizing what would happen if you wanted to list all the seasons where a particular driver had won the championship e.g:
You probably wouldn’t want this list to include the current season (which Jenson is currently leading but hasn’t necessarily won). To solve your problem I would make two queries:
then check whether the last season attribute returned by the first query is the same as the season attribute returned by the second. If so, ignore the second query.
Obviously, if the two season attribute values are different it means that the current season is still in progress and therefore the second query is returning interim standings, rather than final standings. Hope that helps.
Great work, excellent API. One problem: in 1988 only the top 11 results counted towards a drivers WDC points, so although Prost scored more points than Senna, Senna was champion. The API lists Senna’s position as 2nd.
Thanks Bob. Now corrected. The results followed the “Top 11″ rule up to the 1981 but not thereafter for some reason. The points have now been corrected 1981-1991. I think 1988 championship was the only place where the problem affected the standings.
Hi,
Python’s simplejson parser is tripping up on the drivers data because there is a trailing comma on the nationalities property, see here:
http://ergast.com/api/f1/2010/drivers.json
This is not happening in the other api’s I’m using, even the ones that contain driver data, like results for example:
http://ergast.com/api/f1/current/last/results.json
Constructors is a similar api which is also working ok:
http://ergast.com/api/f1/2010/constructors.json
As a workaround I’m pulling driver data from the results api, which is a little inefficient for you so I hope you forgive me
Thanks for the api, I’m using it to power our little fantasy formula 1 league in the office.
Darren
Thanks Darren – it’s now fixed.
Hi,
When I query the database for, say, Alonso’s all-time results, I use the following URL: http://ergast.com/api/f1/drivers/alonso/driverStandings
I get his 8 first seasons results, however, the 2010 season does not appear.
Is this intended, or is it a bug?
Which solution is best to get *all* results from up to today for a given driver? Should I add something like http://ergast.com/api/current/f1/drivers/alonso/driverStandings and check if there’s 0 or 1 result? At the end of the season, won’t I be counting the last results twice?
Note: this behavior might not be consistent with getting all *race* results with the URL: http://ergast.com/api/f1/drivers/alonso/results
In that case I do get the 2010 race results too.
Thanks in advance,
Romain
Romain,
I’ve considered this issue in the past and neither of the two possible behaviours is ideal in all circumstances. The deciding factor for me was realizing what would happen if you wanted to list all the seasons where a particular driver had won the championship e.g:
http://ergast.com/api/f1/drivers/button/driverStandings/1
You probably wouldn’t want this list to include the current season (which Jenson is currently leading but hasn’t necessarily won). To solve your problem I would make two queries:
http://ergast.com/api/f1/drivers/alonso/driverStandings
http://ergast.com/api/f1/current/drivers/alonso/driverStandings
then check whether the last season attribute returned by the first query is the same as the season attribute returned by the second. If so, ignore the second query.
Obviously, if the two season attribute values are different it means that the current season is still in progress and therefore the second query is returning interim standings, rather than final standings. Hope that helps.
Great work, excellent API. One problem: in 1988 only the top 11 results counted towards a drivers WDC points, so although Prost scored more points than Senna, Senna was champion. The API lists Senna’s position as 2nd.
Thanks Bob. Now corrected. The results followed the “Top 11″ rule up to the 1981 but not thereafter for some reason. The points have now been corrected 1981-1991. I think 1988 championship was the only place where the problem affected the standings.
Seems to be down today?
All of my requests response are,
“scgiwrap: Caller must be the nobody user”
Apologies for the outtage. There was a major upgrade by the hosting site this weekend which took out all my PHP scripts.
HI,
really looking forward to using this with sencha 2 but found the following problem.
The jsonp callback has dots like this.
http://ergast.com/api/f1/seasons.json?_dc=1332628009729&node=root&page=1&start=0&limit=25&callback=Ext.data.JsonP.callback2
It appears that the dots in the callback function cause a bad request. Is it possible to fix or suggest a work around.
Many thanks
Hi Sean,
Ok. It should work now. I was being overly cautious in restricting callbacks to function names.
Let me know if you build something interesting.
Nice one admin that has done the trick. I will let you know when I something decent, but don’t hold your breath I have just become a daddy