
Show HN: World Cup API for 2018 - llamataboot
http://worldcup.sfg.io/
======
ealexhudson
Timezones look wrong. This is the stamp for today's match:

2018-06-14T17:00:00.000-05:00

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!

~~~
rurban
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

------
llamataboot
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.

------
chunkyslink
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.

~~~
llamataboot
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.

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

------
philbarr
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?

------
m4tthumphrey
Slightly related: My friends have created
[https://wcfixtures.football](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](https://www.football-data.org) or scape themselves.

~~~
code_boy_code
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.

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

[https://getdata.io/data-sources/5470-football-statistics-
foo...](https://getdata.io/data-sources/5470-football-statistics-football-
live-scores-whoscored-com)

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

------
tallytarik
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!

------
sschueller
[http://worldcup.sfg.io/matches](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)

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

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

------
dblooman
Anyone got a lambda based slack bot for WC?

~~~
rblanch
You can try this
[https://guessthewinner.blinch.site/](https://guessthewinner.blinch.site/) (I
built it) You can read about it here: [https://medium.com/@blinch/what-did-i-
learn-while-building-a...](https://medium.com/@blinch/what-did-i-learn-while-
building-a-product-for-offices-watching-the-world-cup-6e32220bfae4) Help me
share it, this is my first response in HN

------
garyjob
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.

[https://getdata.io/data-sources/5471-fifa-world-cup-
fourfour...](https://getdata.io/data-sources/5471-fifa-world-cup-fourfourtwo-
world-cup-news)

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

------
dmlittle
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.

[https://gist.github.com/dmlittle/9733711dcfa638b304884198d75...](https://gist.github.com/dmlittle/9733711dcfa638b304884198d759deba)

------
deanclatworthy
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!

~~~
secstate
You can try: pip install worldcup

And then: watch -n 60 worldcup today

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

~~~
zimpenfish
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...

~~~
llamataboot
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.

------
Ylodi
[http://worldcup.sfg.io/matches/country?fifa_code=cro](http://worldcup.sfg.io/matches/country?fifa_code=cro)

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.

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

[https://gist.github.com/int9h/83373326174ce8dab25a333a9c36f0...](https://gist.github.com/int9h/83373326174ce8dab25a333a9c36f0d3)

------
daw___
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.

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

------
bdz
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.)

~~~
SlashmanX
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](https://en.wikipedia.org/wiki/World_Football_Elo_Ratings)

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

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

------
Double_a_92
Is there no official API?

~~~
jetti
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.

~~~
llamataboot
They are expensive, hence a free one

------
0b01
It's 'Colombia' not ,Columbia'

