Comments (27)
Looks like the api changed completely:
- https://api.fifa.com/api/v1/calendar/matches?idCompetition=17&idSeason=254645&idStage=275073&language=all&count=500
- https://api.fifa.com/api/v1/live/football/17/254645/275073/300331533?language=en-GB
I'll have to wait for the match to see how it is handled.
from worldcup-slack-bot.
I won't be available at all until Monday but here what I found digging into the API (using the FIFA App on my iPhone and the Charles Proxy app on my Mac). I almost found what I need to update the bot, I just need some extra help in the mean time.
The live feed of the today's game is here (I don't think the language parameter is useful):
https://api.fifa.com/api/v1/timelines/17/254645/275073/300331503?language=fr-FR
300331503
is the game id which can be found in that api call:
https://api.fifa.com/api/v1/calendar/matches?idCompetition=17&idSeason=254645&idStage=275073&language=all&count=500
Anyway, from the timeline url, there are a lot of different Type
:
- Type: 19
- Type: 7
- Type: 27
- etc.
These types are a kind of action in the game. Like a goal, the end of a period, a fault, etc.
This is the bored part of the bot: find which action is each type id.
I already found:
- 8 is a period end (first or second)
- 26 is the end of the game
- 39 is a goal from a free kick
Each action is listed under the "direct" (in french, maybe timeline in english) of a game, here is a screenshot:
👉So, if you guys can find out which action is linked to which type id, it'll help me a lot 👍
Free kick event contains the related team, player, etc..
{
EventId: "1131239410",
IdTeam: "43965",
IdPlayer: "371639",
IdSubPlayer: "404372",
Timestamp: "2018-06-14T16:54:13.051Z",
MatchMinute: "90'+4'",
Period: 5,
HomeGoals: 5,
AwayGoals: 0,
Type: 39,
TypeLocalized: [],
PositionX: 0.621143,
PositionY: -0.232647,
GoalGatePositionX: 1,
GoalGatePositionY: -0.077353,
GoalGatePositionZ: 0.107,
VarDetail: null,
HomePenaltyGoals: 0,
AwayPenaltyGoals: 0
}
from worldcup-slack-bot.
From the fifa.com website, I picked one of the games, lists the match events and I dig into their files. They are using client-side scripts to display events.
from worldcup-slack-bot.
I need to check if the official API got an update or if it still works the same as 4 years ago (I doubt).
from worldcup-slack-bot.
Do we have any news?
from worldcup-slack-bot.
from worldcup-slack-bot.
Hi @j0k3r do you know if there are API specifications for the api.fifa.com?
from worldcup-slack-bot.
I don’t know. I just sniffed calls from their iOS app.
from worldcup-slack-bot.
Was looking to use this for our company pool. Any hope for an update and maybe english support? :)
from worldcup-slack-bot.
hello here any update ?
from worldcup-slack-bot.
There's also http://api.football-data.org/v1/fixtures/165084
from worldcup-slack-bot.
Some educated guesses:
- Type 0 = goal from open play
- Type 1 = assist
- Type 2 = yellow card
- Type 3 = red card
- Type 4 = double yellow card
- Type 5 = substitution (there have been 6 per match, 3 per team, with no position data)
- Type 7 = period start
- Type 8 = period end
- Type 12 = shot (blocked / missed?)
- Type 14 = free kick taken
- Type 15 = offside
- Type 16 = corner kick taken
- Type 17 = tackle / change of possession / goal kick (maybe?)
- Type 18 = foul
- Type 19 = new game (maybe? all matches seem to start with this, then 7)
- Type 22 = goal kick?
- Type 24 = throw in taken
- Type 26 = end of the game
- Type 32 = crossbar (left / right ?)
- Type 33 = crossbar (left / right ?)
- Type 34 = own goal
- Type 37 = handball
- Type 39 = goal from a free kick
- Type 41 = goal from penalty kick
- Type 49 = shot from a free kick (less sure about this one)
- Type 65 = missed penalty
- Type 72 = foul in penalty area
from worldcup-slack-bot.
- "Type": 0 - Regular Goal Scored
- "Type": 1 - Assist
- "Type": 5 - Substitution
- "Type": 14 - Yellow Card -> different from @andyworsley
- "Type": 10 - New Match
- "Type": 39 - Goal from free kick
- "Type": 41 - Goal from penalty kick
- "Type": 71 - Penalty kick
from worldcup-slack-bot.
@fmoctezuma I'd have to disagree with a couple:
- 71 - There were 4 x Type 71 in the Morocco-Iran game, but no penalties. It's a complex type, but doesn't relate to a team or player. It just looks like some sort of additional information.
- 14 - There were 35 type 14's in the Morocco-Iran game, so this can't be a yellow card. You can see that 18 (foul) is almost always followed by 14 (free kick).
from worldcup-slack-bot.
ok yeah let's remove those, did you compare the rest ? @andyworsley
from worldcup-slack-bot.
@fmoctezuma I've added the other to my comments to keep them in one place, except 10? Most matches seem to start with 19 then 7 (occasionally some 71s before), and then a 7 after half time as well. So I'm guessing 19 is something to do with the start of the match, and then 7 is a period kick-off.
from worldcup-slack-bot.
cool, the list looks much better, we are missing red cards and owngoals types, but so far is probably a good start.
from worldcup-slack-bot.
I got Type 34 = own goal from the Iran game.
from worldcup-slack-bot.
Here's why I found so far that have not been mentionned yet: :
BLOCKED_SHOT = 12
OFFSIDE = 15
CROSSBAR = 32 & 33 (Horizontal / Vertical?)
PENALTY_MISSED = 60
from worldcup-slack-bot.
Awesome guys, good job.
@RickyNotaro missed penalty isn't 65 as @andyworsley comments?
@andyworsley I'll soon review you PR too 👍
from worldcup-slack-bot.
Hello j0k3r,
Thanks for taking care of the update. Is there anything else we can help you with at the moment to try and get it faster ? :)
Thanks !
from worldcup-slack-bot.
Been running this in the cloud for a day or so, and today I'm seeing some sort of rate-limiting/caching of the backend requests by the FIFA API CDN (Akamai). It keeps returning stale responses to the /matches
endpoint at least i.e. the whole Belgium-Panama game it did not update the match to 3 = 'in progress'. But when I made the request from my machine, it was correct.
Might just be that query though, so maybe refactor to use the /live/football/now
instead to see live matches, and filter out non World Cup (competition = 17) ones. Or just grab a static list of the match IDs?
Hopefully the /timelines
endpoint isn't as affected, although I did see it get behind a bit earlier too.
from worldcup-slack-bot.
I think we should better use If-None-Match
with the ETAG from a previous call to avoid too many request. If the server respond a 304, we don't have to go further.
GET | /api/v1/calendar/matches?from=2018-06-17T20:00:00Z&to=2018-06-18T21:59:59Z&language=all&count=500 |
---|
In response header we have:
ETag | "2297675789" |
---|
Then, on the next request:
GET | /api/v1/calendar/matches?from=2018-06-17T20:00:00Z&to=2018-06-18T21:59:59Z&language=all&count=500 |
---|---|
If-None-Match | "2297675789" |
We'll receive:
HTTP/1.1 304 Not Modified
Content-Type: application/json; charset=utf-8
ETag: "2297675789"
Cache-Control: must-revalidate, no-cache
Date: Mon, 18 Jun 2018 20:08:08 GMT
Access-Control-Allow-Origin: *
Connection: keep-alive
from worldcup-slack-bot.
@j0k3r Agreed, anything to reduce requests (especially on the /matches
or /live
endpoints) is good. I didn't realise it returned those headers. Well spotted!
from worldcup-slack-bot.
FMPOV the bot is now ready for the 2018 edition.
Thanks all for the help and enjoy the game! ⚽️🇷🇺
from worldcup-slack-bot.
the full list
Goal = 0
Assist = 1
YellowCard = 2
RedCard = 3
Red2Yellow = 4
Substitution = 5
Penalty = 6
StartTime = 7
EndTime = 8
PauseTime = 9
ResumeTime = 10
Suspension = 11
Shot = 12
BigChance = 13
FreeKick = 14
Offside = 15
Corner = 16
Save = 17
Foul = 18
TossCoin = 19
Dribbling = 20
Skill = 21
Tackle = 22
DroppedBall = 23
ThrowIn = 24
Clearance = 25
EndMatch = 26
AerialDuel = 27
BallOut = 28
Punch = 29
Claim = 30
TimeOut = 31
HitBar = 32
HitPost = 33
OwnGoal = 34
PenaltyShootOut = 35
SecondPenalty = 36
HandBall = 37
Simulation = 38
GoalFromFreeKick = 39
GoalFromIndirectKick = 40
GoalFromPenalty = 41
GoalFromSecondPenalty = 42
GoalOverhead = 43
HitBarFromFreeKick = 44
HitBarFromIndirectKick = 45
HitBarFromPenalty = 46
HitBarFromSecondPenalty = 47
HitBarOverhead = 48
HitPostFromFreeKick = 49
HitPostFromIndirectKick = 50
HitPostFromPenalty = 51
HitPostFromSecondPenalty = 52
HitPostOverhead = 53
ShotFromIndirectKick = 54
ShotFromPenalty = 55
ShotOverhead = 56
SaveByGoalKeeper = 57
SaveFromFreeKick = 58
SaveFromIndirectKick = 59
SaveFromPenalty = 60
SaveFromSecondPenalty = 61
SaveOverhead = 62
BallOutFromFreeKick = 63
BallOutFromIndirectKick = 64
BallOutFromPenalty = 65
BallOutFromSecondPenalty = 66
BallOutOverhead = 67
EndTimeWithExtra = 68
EndTimeWithPSO = 69
StartMatch = 70
VarNotification = 71
FoulCausingPenalty = 72
Unknown = 9999
from worldcup-slack-bot.
@iabuhilal interesting, where did you get the list?
from worldcup-slack-bot.
Related Issues (8)
- unable to start the app HOT 2
- double posting HOT 6
- Extra time and Penalties HOT 1
- Women's World Cup? HOT 5
- PHP Warning HOT 1
- Straight red card type number HOT 3
- Add VAR support HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from worldcup-slack-bot.