API-FOOTBALL

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

10 / 10

延迟

338ms

服务等级

100%

返回所有讨论

call api get error pls advise

avatar
tech-dhzFhu5i_
a month ago

Error/Missing application key. Go to https://www.api-football.com/documentation-v3 to learn how to get your API application key.

avatar
api-sports commented a month ago

Hi,

Can you be more precise ?

Have you put the api-key in the headers as indicated in the documentation ==> https://www.api-football.com/documentation-v3#section/Sample-Scripts

Best

avatar
tech-dhzFhu5i_ commented a month ago

Hi,
I have test with my code sample:
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri(“https://v3.football.api-sports.io/fixtures?date=2021-01-29”),
Headers =
{
{ “x-rapidapi-key”, “750e5ff3a4ms*****************fe2jsnb6a2e3a93623” },//
{ “x-rapidapi-host”, “v3.football.api-sports.io” }
},
};
using var response = client.SendAsync(request).Result;
response.EnsureSuccessStatusCode();
var body = response.Content.ReadAsStringAsync();
Console.WriteLine(body);

but still get error missing application key we get error. Last month we still call api normally but now api always return error

avatar
api-sports commented a month ago

Hi,

On rapidapi you have to use this url as indicated in the documentation ==> https://www.api-football.com/documentation-v3#section/Authentication

==> https://api-football-v1.p.rapidapi.com/v3/

var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri(“https://api-football-v1.p.rapidapi.com/v3/fixtures?date=2021-01-29”),
Headers =
{
{ “x-rapidapi-key”, “750e5ff3a4ms*****************fe2jsnb6a2e3a93623” },//
{ “x-rapidapi-host”, “api-football-v1.p.rapidapi.com” }
},
};
using var response = client.SendAsync(request).Result;
response.EnsureSuccessStatusCode();
var body = response.Content.ReadAsStringAsync();
Console.WriteLine(body);

Best

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

登录/注册以发布新的评论
打分:3.7 - 投票:53