有人能让我知道是否有一个Live Score API像谷歌金融API可用的jQuery和Ajax?
我在谷歌上搜索了3个多小时,我唯一找到的是一个WordPress插件。你能让我知道如果这是可行的使用jQuery和Ajax?由于
欧足联或国际足联似乎没有提供直接的API来获取信息
使用optasports或espn
例:http://developer.espn.com
1)请求您的开发人员密钥(注册)
2)确认你的电子邮件地址
3)http://developer.espn.com/io-docs put API Key:
那么你将得到json或XML格式的数据
http://api.espn.com/:version/:resource/:method?apikey=:yourkey
然后http://api.espn.com/v1/sports/baseball/mlb/events
ESPN已经停止了他们的公共api…检查这个http://espn.go.com/static/apis/devcenter/blog/read/publicretirement.html
Hooks Data为美国主要体育项目提供实时API,包括NFL, MBL, NBA, Soccer, NHL。
1)获取API KEY: https://www.hooksdata.io/signup?invite=SM4555
2)订阅足球比赛结果:
curl -H "Content-type: application/json" -d '{
"query": "SELECT * FROM SoccerGames WHERE away_team.team_name = 'Real Madrid' OR home_team.team_name = 'Real Madrid' AND start_datetime.countdown = 3600"}' 'http://api.hooksdata.io/v1/subscriptions'
3)可选:添加一个Webhooks URL,你想获得的数据:https://www.hooksdata.io/webhooks
4)使用取回端点https://www.hooksdata.io/docs/api/api-reference/#query-datasource提取数据
5)获取JSON格式的所有数据:{
"matches_count": 1,
"results": [
{
"_entity_type": "SoccerGame",
"_id": "SoccerGame_490555",
"away_score": null,
"away_team": {
"_entity_type": "SoccerTeam",
"_id": "SoccerTeam_86",
"espn_id": 86,
"id": "SoccerTeam_86",
"logo_url": "http://a.espncdn.com/combiner/i?img=/i/teamlogos/soccer/500/86.png&h=500",
"team_name": "Real Madrid"
},
"competition": "Spanish Primera División",
"game_id": "490555",
"home_score": null,
"home_team": {
"_entity_type": "SoccerTeam",
"_id": null,
"team_name": "Leganes"
},
"link": "http://m.espn.go.com/soccer/gamecast?gameId=490555&lang=EN&wjb=",
"start_datetime": {
"countdown": 86970,
"datetime": "2018-02-21T17:45:00+0000",
"timestamp": 1519235100
},
"status": "FUTURE",
"timestamp": 1519235100
}
]}
如果你也想在你的网站上有视频(进球,集锦)- ScoreBat提供了一个免费的API - https://www.scorebat.com/video-api/