Hacker News new | comments | ask | show | jobs | submit login
Show HN: World Cup API for 2018 (sfg.io)
141 points by llamataboot 8 months ago | hide | past | web | favorite | 41 comments

Timezones look wrong. This is the stamp for today's match:


Moscow is GMT+3, and kick-off is 18h local time (i.e. 15h GMT). Not sure what combination of stuff has gone wrong there!

Yes, the minutely update seems to be off by 2 hrs at least. The first match is already 3:0, but the API still has 0:0

Hi all -- Sorry for not updating sooner -- FIFA changed things significantly from 2014 and I had to do a bunch of updating to the scraper to use headless chrome to pull in updates via JS to get all the events working again.

Everything should be working in real time for tomorrow's games. Real time goals, matches marked completed after they are officially over, and an event stream of goals, subs, and cards.

Sorry for delay, hard to scrape data until it actually exists, and besided the 50+ emails I got in the past few months asking me to make it work for 2018, I was the only one making PRs ;)

Should be good to go for tomorrow, please file a github issue if you see any problems.

There are a quite a few problems with this. We are 31 minutes into the first game (Russia vs Saudi A) and it is 1 - nil.

This feed (although updated each minute) is not reflecting the score. Also the current game endpoint is empty.

As one poster has pointed out the timezone setting are wrong which could be why.

nope, was just problems with scraping data -- can't scrape data until it exists (FIFA is using a new CMS for World Cup 2018 that uses a fair amount of JS), and I couldn't get all the events that are used to mark a match officially completed.

Should be working now for the next games. First day is always a bit of a mess.

WhoScored and the StatsZone app are both wonderful to scrape if anybody wanted to poke around harder for more detailed data.

This looks great! The background page says you were scraping the data from websites. Are you still doing that? If so:

- did you ask permission? Did you feel you had to?

- do you have problems with sites accidentally/deliberately breaking your parsing code?

Slightly related: My friends have created https://wcfixtures.football. For some reason they only made it work on mobile. We did a similar one back in 2014 but I was not involved in this one. I imagine they use https://www.football-data.org or scape themselves.

Forgot to say thank you for this. I had a look at this yesterday and I love it. So clean. - pass on my thanks to your dev friends.

Hey guys, I just created an API with my App for WhoScored. Its currently running very 15mins.


Will update again once I got another API setup for StatsZone when ready.

By the way, how often do you guys need data refresh for? Once I get some feedback I could tweak my app to increase the number of frequency.

Also please do ping me if you want to register your webhooks. My app only supports only one webhook per API at the moment. I will try to get it properly extended so that all your webhooks can get registered.

My email address is garyjob@getdata.io

Nice! I built a World Cup IRC bot back in 2014 but couldn't find a reliable API. In the end I found the only way I could get realtime results was by streaming from the official Twitter page, as they posted live match updates in a (reasonably) predictable format.

All the best with your API this World Cup!

http://worldcup.sfg.io/matches The time zone seems off. I get "datetime": "2018-06-14T17:00:00.000-05:00" for the first match.

It should however be 17:00 for CEST (UTC +2)

Time zones are always a pain, I'll check into it now that I got all the events working!

I’ve been using https://www.football-data.org which is also an API for the World Cup, does anyone know the pros and cons of the 2?

Anyone got a lambda based slack bot for WC?

You can try this https://guessthewinner.blinch.site/ (I built it) You can read about it here: https://medium.com/@blinch/what-did-i-learn-while-building-a... Help me share it, this is my first response in HN

I don't see any match related data from StatsZone at the moment, but I have created an API for the world cup related news articles that are being published on the site.


I will check again to see if there are any new data once the match starts and then create an API for those too.

The FIFA API is hard to understand but has all of the info as well. Here's a list of all matches in the group stages; I don't believe the round of 16 matches have been generated yet.


Has anyone made a dashboard out of this? Would like to put something on our displays at the office but no time to do it myself!

I know this was ages ago, but I've created a daily dashboard for today's games using this API: http://worldcupgames.today/

You can try: pip install worldcup

And then: watch -n 60 worldcup today

And just make the font in the terminal window huge :)

At least on my server, I needed to run

    pip2 install worldcup       # didn't like Python3
    watch -cn 60 worldcup today # -c for colours
Also the time handling seems wrong - it claims Russia vs Saudia Arabia will be "9 hours from now" except it kicks off in 2.5 hours...

yup, all events and goals should happen in real time starting tomorrow, first day is always a mess because it is a scraper and FIFA is using a new CMS this year. Thought I had it worked, but had to make some sig changes to account for lots of JS.

Events and status changes and goals should all update in realtime now.


Internal Server Error?

I was expecting 404 in the worst case, but parameter case conversion (upper to low and vice versa) would be a better solution.

Nice. Build a little py script for work. :]


I tried loading over HTTPS and got the following error:

    This server could not prove that it is
    worldcup.sfg.io; its security certificate
    is from *.herokuapp.com. This may be
    caused by a misconfiguration or an
    attacker intercepting your connection.

I'll look into HTTPS, heroku says it is configured fine for worldcup.sfg.io, browser says it isn't, browser wins :)

I have the same issue. Can't use inside my Preact component running on a https site.

Kinda unrelated but does anyone know where do Google get the win probability numbers from on the match pages? Is it something scientific or some "social" numbers (like which team is more popular, more searches etc.)

I believe they use the ELO Ratings[0]. they have the Win Probability on their website[1].

[0] - https://en.wikipedia.org/wiki/World_Football_Elo_Ratings

[1] - http://eloratings.net/fixtures

A popular method is described in this paper:


I suppose through some kind of machine learning, given the fact that they have a miriad of data of any kind.

It might look like a funny experiment/excercise for someone at Google.

You could very easily source it from betting markets.

Nice, is there an end point to get the champion?

Is there no official API?

There are definitely other APIs for commercial use that don't rely on scraping but the problem is that they aren't free. Sports data can get very expensive.

They are expensive, hence a free one

There probably is but with FIFA you most definitely have to pay.


there's an api used by the official mobile app. https://api.fifa.com/worldcup/

If someone has reversed it and could share any documentation, pls write in comments

I couldn't find any documentation but here's the list of match endpoints: https://news.ycombinator.com/item?id=17330254

It's 'Colombia' not ,Columbia'

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact