API-BASKETBALL

GRATIS CON POSSIBILITÀ DI UPGRADE
Verified
Da API-SPORTS | Aggiornamento 8 days ago | Sports
Popolarità

9.9 / 10

Latenza

343ms

Livello di servizio

99%

Health Check

N/A

Torna a tutte le discussioni

No NCAA games returned today

Rapid account: Torg
torg
2 years ago

I am not getting any NCAA games today. Included is code from the playground, returning 0 results.

<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => “https://api-basketball.p.rapidapi.com/games?timezone=America%2FChicago&season=2021-2022&league=116&date=2022-03-07”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “GET”,
CURLOPT_HTTPHEADER => [
“x-rapidapi-host: api-basketball.p.rapidapi.com”,
“x-rapidapi-key: --privage key removed----”
],
]);

response=curlexec(response = curl_exec(curl);
err=curlerror(err = curl_error(curl);

curl_close($curl);

if ($err) {
echo “cURL Error #:” . $err;
} else {
echo $response;
}

Rapid account: Torg
torg Commented 2 years ago

OK. I see the issue. The timezone parameter is applied after the query is made. I was requesting games today, using the timezone parameter, assuming I would get games today in my timezone. Appears that is not the case.

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

Hi,

You should get 7 results :

{
get: "games"
parameters: {
league: "116"
season: "2021-2022"
date: “2022-03-07”
}
errors: [
]
results: 7
response: [
{
id: 156137
date: "2022-03-07T00:00:00+00:00"
time: "00:00"
timestamp: 1646611200
timezone: "UTC"
stage: null
week: null
status: {
long: "Game Finished"
short: "FT"
timer: null
}
league: {
id: 116
name: "NCAA"
type: "League"
season: "2021-2022"
logo: “https://media.api-sports.io/basketball/leagues/116.png
}
country: {
id: 5
name: "USA"
code: "US"
flag: “https://media.api-sports.io/flags/us.svg
}
teams: {
home: {
id: 1498
name: "South Dakota Coyotes"
logo: “https://media.api-sports.io/basketball/teams/1498.png
}
away: {
id: 1505
name: "UMKC"
logo: “https://media.api-sports.io/basketball/teams/1505.png
}
}
scores: {
home: {
quarter_1: 0
quarter_2: 38
quarter_3: 0
quarter_4: 36
over_time: null
total: 74
}
away: {
quarter_1: 0
quarter_2: 33
quarter_3: 0
quarter_4: 28
over_time: null
total: 61
}
}
}
{
id: 155919
date: "2022-03-07T00:30:00+00:00"
time: "00:30"
timestamp: 1646613000
timezone: "UTC"
stage: null
week: null
status: {
long: "Game Finished"
short: "FT"
timer: null
}
league: {
id: 116
name: "NCAA"
type: "League"
season: "2021-2022"
logo: “https://media.api-sports.io/basketball/leagues/116.png
}
country: {
id: 5
name: "USA"
code: "US"
flag: “https://media.api-sports.io/flags/us.svg
}
teams: {
home: {
id: 1944
name: "Illinois"
logo: “https://media.api-sports.io/basketball/teams/1944.png
}
away: {
id: 1950
name: "Iowa"
logo: “https://media.api-sports.io/basketball/teams/1950.png
}
}
scores: {
home: {
quarter_1: 0
quarter_2: 37
quarter_3: 0
quarter_4: 37
over_time: null
total: 74
}
away: {
quarter_1: 0
quarter_2: 43
quarter_3: 0
quarter_4: 29
over_time: null
total: 72
}
}
}
{
id: 155920
date: "2022-03-07T00:30:00+00:00"
time: "00:30"
timestamp: 1646613000
timezone: "UTC"
stage: null
week: null
status: {
long: "Game Finished"
short: "FT"
timer: null
}
league: {
id: 116
name: "NCAA"
type: "League"
season: "2021-2022"
logo: “https://media.api-sports.io/basketball/leagues/116.png
}
country: {
id: 5
name: "USA"
code: "US"
flag: “https://media.api-sports.io/flags/us.svg
}
teams: {
home: {
id: 2053
name: "Northwestern"
logo: “https://media.api-sports.io/basketball/teams/2053.png
}
away: {
id: 2003
name: "Minnesota"
logo: “https://media.api-sports.io/basketball/teams/2003.png
}
}
scores: {
home: {
quarter_1: 0
quarter_2: 46
quarter_3: 0
quarter_4: 29
over_time: null
total: 75
}
away: {
quarter_1: 0
quarter_2: 26
quarter_3: 0
quarter_4: 36
over_time: null
total: 62
}
}
}
{
id: 156245
date: "2022-03-07T01:30:00+00:00"
time: "01:30"
timestamp: 1646616600
timezone: "UTC"
stage: null
week: null
status: {
long: "Game Finished"
short: "FT"
timer: null
}
league: {
id: 116
name: "NCAA"
type: "League"
season: "2021-2022"
logo: “https://media.api-sports.io/basketball/leagues/116.png
}
country: {
id: 5
name: "USA"
code: "US"
flag: “https://media.api-sports.io/flags/us.svg
}
teams: {
home: {
id: 1813
name: "Appalachian State"
logo: “https://media.api-sports.io/basketball/teams/1813.png
}
away: {
id: 1925
name: "Georgia State"
logo: “https://media.api-sports.io/basketball/teams/1925.png
}
}
scores: {
home: {
quarter_1: 0
quarter_2: 29
quarter_3: 0
quarter_4: 37
over_time: null
total: 66
}
away: {
quarter_1: 0
quarter_2: 38
quarter_3: 0
quarter_4: 33
over_time: null
total: 71
}
}
}
{
id: 156246
date: "2022-03-07T01:30:00+00:00"
time: "01:30"
timestamp: 1646616600
timezone: "UTC"
stage: null
week: null
status: {
long: "Game Finished"
short: "FT"
timer: null
}
league: {
id: 116
name: "NCAA"
type: "League"
season: "2021-2022"
logo: “https://media.api-sports.io/basketball/leagues/116.png
}
country: {
id: 5
name: "USA"
code: "US"
flag: “https://media.api-sports.io/flags/us.svg
}
teams: {
home: {
id: 188
name: "Hofstra"
logo: “https://media.api-sports.io/basketball/teams/188.png
}
away: {
id: 1861
name: "Charleston"
logo: “https://media.api-sports.io/basketball/teams/1861.png
}
}
scores: {
home: {
quarter_1: 0
quarter_2: 33
quarter_3: 0
quarter_4: 43
over_time: null
total: 76
}
away: {
quarter_1: 0
quarter_2: 55
quarter_3: 0
quarter_4: 37
over_time: null
total: 92
}
}
}
{
id: 156138
date: "2022-03-07T02:30:00+00:00"
time: "02:30"
timestamp: 1646620200
timezone: "UTC"
stage: null
week: null
status: {
long: "Game Finished"
short: "FT"
timer: null
}
league: {
id: 116
name: "NCAA"
type: "League"
season: "2021-2022"
logo: “https://media.api-sports.io/basketball/leagues/116.png
}
country: {
id: 5
name: "USA"
code: "US"
flag: “https://media.api-sports.io/flags/us.svg
}
teams: {
home: {
id: 2064
name: "Oral Roberts"
logo: “https://media.api-sports.io/basketball/teams/2064.png
}
away: {
id: 2200
name: "Western Illinois"
logo: “https://media.api-sports.io/basketball/teams/2200.png
}
}
scores: {
home: {
quarter_1: 0
quarter_2: 43
quarter_3: 0
quarter_4: 37
over_time: null
total: 80
}
away: {
quarter_1: 0
quarter_2: 31
quarter_3: 0
quarter_4: 37
over_time: null
total: 68
}
}
}
{
id: 156247
date: "2022-03-07T23:00:00+00:00"
time: "23:00"
timestamp: 1646694000
timezone: "UTC"
stage: null
week: null
status: {
long: "Not Started"
short: "NS"
timer: null
}
league: {
id: 116
name: "NCAA"
type: "League"
season: "2021-2022"
logo: “https://media.api-sports.io/basketball/leagues/116.png
}
country: {
id: 5
name: "USA"
code: "US"
flag: “https://media.api-sports.io/flags/us.svg
}
teams: {
home: {
id: 2152
name: "Towson"
logo: “https://media.api-sports.io/basketball/teams/2152.png
}
away: {
id: 1884
name: "Delaware"
logo: “https://media.api-sports.io/basketball/teams/1884.png
}
}
scores: {
home: {
quarter_1: null
quarter_2: null
quarter_3: null
quarter_4: null
over_time: null
total: null
}
away: {
quarter_1: null
quarter_2: null
quarter_3: null
quarter_4: null
over_time: null
total: null
}
}
}
]
}

Partecipa alla discussione - aggiungi un commento di seguito:

Accedi/Iscriviti per pubblicare nuovi commenti