jQuery Ajax和Soccer Live Score API

时间:2014-06-04 07:37:46

标签: javascript jquery google-api

如果有一个像Google财经API这样的Live Score API可供jQuery和Ajax使用,请告诉我一些人吗?

我谷歌这个超过3个小时,我发现的唯一的东西是一个WordPress插件。如果使用jQuery和Ajax这是可行的,你能告诉我吗?感谢

4 个答案:

答案 0 :(得分:4)

UEFA或FIFA似乎不提供直接API来获取信息

使用optasportsespn

例如:http://developer.espn.com

1)请求您的开发人员密钥(注册)

2)确认您的电子邮件地址

3)http://developer.espn.com/io-docs放置API密钥:

然后您将获得json或XML格式数据

http://api.espn.com/:version/:resource/:method?apikey=:yourkey

然后

http://api.espn.com/v1/sports/baseball/mlb/events

答案 1 :(得分:0)

ESPN已经停止使用他们的公共API .. 检查一下 http://espn.go.com/static/apis/devcenter/blog/read/publicretirement.html

答案 2 :(得分:0)

Hooks Data为美国主要体育项目提供实时API,包括NFL,MBL,NBA,Soccer,NHL。

1)在此处获取API密钥: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网址: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
    }
]}

答案 3 :(得分:0)

如果您还想在网站上播放视频(目标,精彩集锦)-ScoreBat为此提供了免费的API-https://www.scorebat.com/video-api/