API-FOOTBALL

FREEMIUM
Verified
Por API-SPORTS | Atualizado 9 days ago | Sports
Popularidade

10 / 10

Latência

360ms

Nível de serviço

99%

Health Check

N/A

Voltar para todas as discussões

Get Morocco fixtures

Rapid account: Xat
Xat
2 years ago

I would like to get Morocco fixtures of the day, so here is the request :

curl -L ‘https://api-football-v1.p.rapidapi.com/v3/fixtures?date=2022-06-29&league=200&season=2022

Here is the response :
{“get”:“fixtures”,“parameters”:{“league”:“200”,“date”:“2022-06-29”,“season”:“2022”},“errors”:[],“results”:0,“paging”:{“current”:1,“total”:1},“response”:[]}

It seems there is no fixtures today, while there are.

So maybe I am wrong with the League identifier. So I did a search for Morocco :

curl -L ‘https://api-football-v1.p.rapidapi.com/v3/leagues?search=Morocco

Then it returns 3 leagues containing this one : Morocco / Botola Pro with id 200.
So if I am not wrong, my first request is good, but does not return any fixture.

Can you help on this ?
Kind regards.

Rapid account: Xat
Xat Commented 2 years ago

Thanks a lot for this information.

I’ve fixed the code regarding it.

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

Hi,

It’s currently season “2021” not “2022” for this competition, you can get available seasons in the leagues endpoint. And according to the documentation “2021-2022” is season “2021” in the API.

{
get: "fixtures"
parameters: {
league: "200"
season: "2021"
date: “2022-06-29”
}
errors: [
]
results: 8
paging: {
current: 1
total: 1
}
response: [
{
fixture: {
id: 879827
referee: null
timezone: "UTC"
date: "2022-06-29T17:00:00+00:00"
timestamp: 1656522000
periods: {
first: 1656522000
second: null
}
venue: {
id: 1102
name: "Stade Ben Ahmed El Abdi"
city: “Mazghan”
}
status: {
long: "First Half"
short: "1H"
elapsed: 15
}
}
league: {
id: 200
name: "Botola Pro"
country: "Morocco"
logo: "https://media.api-sports.io/football/leagues/200.png"
flag: "https://media.api-sports.io/flags/ma.svg"
season: 2021
round: “Regular Season - 29”
}
teams: {
home: {
id: 964
name: "Difaa EL Jadida"
logo: "https://media.api-sports.io/football/teams/964.png"
winner: null
}
away: {
id: 1074
name: "Youssoufia Berrechid"
logo: "https://media.api-sports.io/football/teams/1074.png"
winner: null
}
}
goals: {
home: 0
away: 0
}
score: {
halftime: {
home: 0
away: 0
}
fulltime: {
home: null
away: null
}
extratime: {
home: null
away: null
}
penalty: {
home: null
away: null
}
}
}
{

Rapid account: Xat
Xat Commented 2 years ago

Seems season 2022 does not exist for league ID 200.

Can you help ?
Thanks a lot.

Junte-se à discussão - adicione o comentário abaixo:

Efetue login / inscreva-se para postar novos comentários