API-FOOTBALL

फ्रीमियम
Verified
द्वारा API-SPORTS | अपडेट किया गया לפני 9 ימים | Sports
लोकप्रियता

10 / 10

लेटेंसी

359ms

सेवा का स्तर

99%

Health Check

N/A

सभी चर्चाओं पर वापस जाएं

Fixture Endpoint

Rapid account: Alexandremjacques
alexandremjacques
לפני 5 שנים

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 שנים

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 שנים

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 שנים

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 שנים

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>

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें