How do you access the NFL's API's?

前端 未结 2 1846
执笔经年
执笔经年 2021-02-02 09:49

I\'ve been trying to access or find away to access data from NFL.com, but have not found it yet. There is public documentation on these sites:

https://api.nfl.co         


        
2条回答
  •  太阳男子
    2021-02-02 10:08

    Hooks Data provides a real-time API for major US sports including NFL.

    1) Get API KEY here: https://www.hooksdata.io/signup?invite=SM4555

    2) Subscribe to soccer games:

    curl -H "Content-type: application/json" -d '{
    "query": "SELECT * FROM NFLGames WHERE away_team.team_name = 'New England Patriots' OR home_team.team_name = 'New England Patriots' AND start_datetime.countdown = 3600"}' 'http://api.hooksdata.io/v1/subscriptions'
    

    DOCS: https://www.hooksdata.io/docs/api/datasources/nflgames/

    3) Optional: Add a Webhooks URL where you want to get the data: https://www.hooksdata.io/webhooks

    4) Pull the data using fetch endpoint https://www.hooksdata.io/docs/api/api-reference/#query-datasource

    5) Get all the data in JSON:

    {
    "matches_count": 1,
    "results": [
        {
            "_entity_type": "NFLGame",
            "_id": "NFLGame_400999173",
            "away_score": null,
            "away_team": {
                "_entity_type": "NFLTeam",
                "_id": "NFLTeam_NE",
                "acronym": "NE",
                "division": "AFC East",
                "id": "NFLTeam_NE",
                "team_name": "New England Patriots"
            },
            "game_id": "400999173",
            "home_score": null,
            "home_team": {
                "_entity_type": "NFLTeam",
                "_id": "NFLTeam_PHI",
                "acronym": "PHI",
                "division": "NFC East",
                "id": "NFLTeam_PHI",
                "team_name": "Philadelphia Eagles"
            },
            "link": "http://espn.go.com/nfl/game?gameId=400999173",
            "start_datetime": null,
            "status": "FUTURE"
        }
    ]
    

    }

提交回复
热议问题