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

前端 未结 2 1842
执笔经年
执笔经年 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"
        }
    ]
    

    }

    0 讨论(0)
  • 2021-02-02 10:21

    While I haven't had any success with api.nfl.com, I am able to get some data from the api.fantasy.nfl.com. You should have read access to all of the /players/* endpoints (e.g. http://api.fantasy.nfl.com/v1/players/stats?statType=seasonStats&season=2010&week=1&format=json). I would think you need an auth token for the league endpoints and the write endpoints.

    How long ago did you email them?

    EDIT: I emailed the NFL and this is what they had to say: "We've passed your API request along to our product and strategy teams. NFL.com Fantasy APIs are available on a per-use, case-by- case basis for NFL partners. Our team reviews other requests, but our APIs are typically not available for external usage otherwise."

    0 讨论(0)
提交回复
热议问题