API-FOOTBALL

フリーミアム
よって API-SPORTS | 更新済み 9 giorni fa | Sports
人気

10 / 10

レイテンシー

359ms

サービスレベル

99%

Health Check

N/A

すべてのディスカッションに戻る

Fixture Endpoint

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 anni fa

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 anni fa

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 anni fa

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 anni fa

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>

ディスカッションに参加しましょう-以下にコメントを追加してください:

ログイン/サインアップして新しいコメントを投稿