API-FOOTBALL

免费增值
Verified
通过 API-SPORTS | 已更新 9 days ago | Sports
人气

10 / 10

延迟

359ms

服务等级

99%

Health Check

N/A

返回所有讨论

Fixture Endpoint

Rapid account: Alexandremjacques
alexandremjacques
5 years ago

Hi, I was trying to consume your API and I noticed that, when calling the api/fixtures/date/{date}, the ‘fixture’ object should be an array of fixtures and it is not.

Is it really by design or is it a bug?

Thanks

Rapid account: Dmjoseph 78
dmjoseph78 Commented 5 years ago

I am a beginner in learning python and want to get data from your api, and basically had it been an array of fixtures, it would be easier for me to fetch the data I need but I am stuck because of the numbers(the ids). Basically what I want is to iterate through all the ids and get, in each id, homeTeam name and awayTeam name. Any help would be appreciated.

Rapid account: Api Sports
api-sports Commented 5 years ago

It will be like this in the V2 planned in 2019.

All endpoints will be reviewed to return a array and not a series of objects

Rapid account: Alexandremjacques
alexandremjacques Commented 5 years ago

I can see that. IMHO, it would make much more sense and would be much easier to parse if fixtures was an array of fixture. Something like:

{
  "api": {
    "results": 56,
    "fixtures": [
       {
        "fixture_id": "664",
        "event_timestamp": "1543002300",
        "event_date": "2018-11-23T19:45:00+00:00",
        "league_id": "3",
        "round": "Championship - 18",
        "homeTeam_id": "57",
        "awayTeam_id": "60",
        "homeTeam": "Ipswich",
        "awayTeam": "West Brom",
        "status": "Not Started",
        "statusShort": "NS",
        "goalsHomeTeam": null,
        "goalsAwayTeam": null,
        "halftime_score": null,
        "final_score": null,
        "penalty": null,
        "elapsed": "0",
        "firstHalfStart": "0",
        "secondHalfStart": "0"
      },
      { ... },
Rapid account: Api Sports
api-sports Commented 5 years ago

Hi,

There is no bug, this is the model :

You can check our documentation at https://www.api-football.com/documentation/

This is the normal return from fixtures/date endpoints :

<pre><code>
{
“api”: {
“results”: 56,
“fixtures”: {
“664”: {
“fixture_id”: “664”,
“event_timestamp”: “1543002300”,
“event_date”: “2018-11-23T19:45:00+00:00”,
“league_id”: “3”,
“round”: “Championship - 18”,
“homeTeam_id”: “57”,
“awayTeam_id”: “60”,
“homeTeam”: “Ipswich”,
“awayTeam”: “West Brom”,
“status”: “Not Started”,
“statusShort”: “NS”,
“goalsHomeTeam”: null,
“goalsAwayTeam”: null,
“halftime_score”: null,
“final_score”: null,
“penalty”: null,
“elapsed”: “0”,
“firstHalfStart”: “0”,
“secondHalfStart”: “0”
},
“1497”: {
“fixture_id”: “1497”,
“event_timestamp”: “1542999600”,
“event_date”: “2018-11-23T19:00:00+00:00”,
“league_id”: “5”,
“round”: “Ligue 2 - 15”,
“homeTeam_id”: “98”,
“awayTeam_id”: “99”,
“homeTeam”: “Ajaccio”,
“awayTeam”: “Clermont Foot”,
“status”: “Not Started”,
“statusShort”: “NS”,
“goalsHomeTeam”: null,
“goalsAwayTeam”: null,
“halftime_score”: null,
“final_score”: null,
“penalty”: null,
“elapsed”: “0”,
“firstHalfStart”: “0”,
“secondHalfStart”: “0”
},
“1498”: {
“fixture_id”: “1498”,
“event_timestamp”: “1542999600”,
“event_date”: “2018-11-23T19:00:00+00:00”,
“league_id”: “5”,
“round”: “Ligue 2 - 15”,
“homeTeam_id”: “109”,
“awayTeam_id”: “105”,
“homeTeam”: “Beziers”,
“awayTeam”: “Valenciennes”,
“status”: “Not Started”,
“statusShort”: “NS”,
“goalsHomeTeam”: null,
“goalsAwayTeam”: null,
“halftime_score”: null,
“final_score”: null,
“penalty”: null,
“elapsed”: “0”,
“firstHalfStart”: “0”,
“secondHalfStart”: “0”
},
</code></pre>

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论