

World Cup data in JSON - llamataboot
http://worldcup.sfg.io/

======
alexcroox
Ugh I struggled to find something like this before I manually built the DB for
[http://wcfixtures.co.uk](http://wcfixtures.co.uk) Dammit!

~~~
sturob
Likewise for [http://sturob.com/wc14/](http://sturob.com/wc14/)

We should aim to do better at collaborating on this sort of thing - before the
tournament starts.

~~~
onk
I've much enjoyed your illustration throughout the group matches.
Interestingly, I've shared it with others and they all fell silent. But once I
explained it to them they liked it a lot and shared it with others. Who also
fell silent. For many people it seems it's too much information/impenetrable.
For me it was a puzzle to solve (as I wasn't current on current round-robin
protocol). Really good work. Keep it up and see you in 4 years!

------
thevlade
But, we have an official API!
[http://live.mobileapp.fifa.com/api/wc/matches](http://live.mobileapp.fifa.com/api/wc/matches)

More details on my last submission here on HN.

~~~
dmn001
Is there any documentation for that api, from the url it looks that they
created it specifically for their official mobile app only?

~~~
thevlade
I haven't found any documentation and, indeed, it was created for their mobile
app.

What I have heard from a guy on Twitter is that if you get the number of the
match then you can:
[http://live.mobileapp.fifa.com/api/wc/match/300186492/en](http://live.mobileapp.fifa.com/api/wc/match/300186492/en)

Also if you put /blog at the end of that URL you get the latest news regarding
that match.

------
anuragbiyani
Created a small bash script to display the current match scores as part of the
terminal prompt :
[https://gist.github.com/abiyani/34f25dc8ed2a862517e7](https://gist.github.com/abiyani/34f25dc8ed2a862517e7)

Sample output: abiyani@vaio:~ [BEL-2-1-ALG, RUS-1-1-KOR, BRA-0-0-MEX]

------
llamataboot
And the obligatory blog post about building it!
[http://softwareforgood.com/soccer-good/](http://softwareforgood.com/soccer-
good/)

~~~
kreek
Somewhat off topic... Your blog looks great, but that's a questionable choice
of header font on the service page, especially when used as all caps :)

~~~
llamataboot
Thanks for the feedback. I just threw something up in a few minutes. I'll try
to get something better looking up tonight with the caveat that I'm not a
designer. Maybe I can get some of my co-workers to design an awesome looking
splash page for me.

~~~
kreek
Looks great now! :)

------
avidas
[http://www.kimonolabs.com/worldcup/docs](http://www.kimonolabs.com/worldcup/docs)
Kimonolabs seems to have one a world cup api too

------
bbfc
I'm using [http://www.optasports.com/](http://www.optasports.com/) for the
worldcup livefeed . Their Sports API is insanely accurate (and expensive).

~~~
dmn001
Yes, I heard that one is expensive. Just out of interest, what are you using
it for?

~~~
iamwithnail
Pretty jealous. I need to get my site together in order to play around with
the Opta historical stuff, I'm working on letting people back test betting
strategies.

------
gberger
Trying to build a Hubot script that broadcasts goals.

How can I know if a goal was scored? Save the last call and compare?

At what rate should I call the API?

~~~
gberger
UPDATE: Built it!

npm: [https://www.npmjs.org/package/hubot-world-cup-
live](https://www.npmjs.org/package/hubot-world-cup-live)

github: [https://github.com/gberger/hubot-world-cup-
live](https://github.com/gberger/hubot-world-cup-live)

~~~
sailfast
This is beautiful. I was looking for an API to do just this exact thing the
other day. Thank you sir.

------
iagooar
I have looked into the code, why do you sometimes use the old hash syntax with
the hashrocket and sometimes the new (>= 1.9) one?

------
Isofarro
There's something funky going on with your homepage.

1.) Open homepage

2.) Click the /matches endpoint link. Json displays

3.) Click back button.

Expected: The homepage displays.

Actual: The URL changes back to the homepage URL, but the matches JSON is
still displayed.

Browser: Safari 7.0.4

~~~
danielrmay
Can replicate for any of the endpoint links, not just /matches.

Chrome Windows Version 35.0.1916.153

------
PeterWhittaker
I'm not sure that I understand the motivation or need for this. Can you not
get match info from your local news feeds?

Perhaps I'm spoiled, because every match is free: cbc.ca/sports-
content/soccer/brazil2014/video/

~~~
llamataboot
Sure, but what if you want to do something with that data? The point of an API
is that it is easily consumable. I explained a bit about why I built it in my
blog post, but mainly it was 1) for fun and learning (I've never built an API
before) 2) to keep the stats updated on a site that I built for my friends for
our world cup draft and 3) to be able to use our company Hubot to ask about
scores throughout the day...but mostly for fun and learning!

~~~
PeterWhittaker
Good answers, thanks.

------
SushiMon
I'd add the Kimono Labs has done something quite similar with their World Cup
API
[http://www.kimonolabs.com/worldcup/explorer](http://www.kimonolabs.com/worldcup/explorer)

------
alexkus
[http://www.live-footballontv.com/](http://www.live-footballontv.com/)

Is where I got for football fixtures for the UK, albeit not JSON.

------
film42
I love this! Looks like HN might be slowing your server down (around 800ms to
grab matches). You should try puma or unicorn instead of webrick.

~~~
llamataboot
I didn't expect it to be quite so popular all of the sudden. :)Looking at
switching it over to Unicorn...

EDIT: switched to unicorn. Please keep me updated about speed issues and I can
turn it up

------
ajanuary
It would be nice to have an endpoint to get a list of teams, though I guess
that data is pretty static.

~~~
llamataboot
That is there too, sorry forgot to document it, just use /teams

------
old_frack
How can I do an AJAX request to your site? Or should I create my own server?

~~~
llamataboot
You can create your own server, but I am looking into adding CORS support this
evening or accepting a pull request that does.

~~~
llamataboot
cross site requests should work fine now

------
lateguy
great stuff.

------
Soarez
Oh cool. Can we have the problems fifa caused in brasil in JSON as well?

