Weather by API-Ninjas

フリーミアム
よって API Ninjas Team | 更新済み 2 months ago | Weather
人気

9.8 / 10

レイテンシー

644ms

サービスレベル

100%

Health Check

N/A

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

Use this JS code. This code will work.

Rapid account: Saurabh 45
Saurabh45
a year ago

const url = ‘https://weather-by-api-ninjas.p.rapidapi.com/v1/weather?city=Lucknow’;
const options = {
method: ‘GET’,
headers: {
‘content-type’: ‘application/octet-stream’,
‘X-RapidAPI-Key’: ‘763c810bdfmshb9f4669b80c3925p18d818jsn3db5be365864’,
‘X-RapidAPI-Host’: ‘weather-by-api-ninjas.p.rapidapi.com
}
};

fetch(url, options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));

Rapid account: Rahulsalve 071
rahulsalve071 Commented 4 days ago

Thanks bro this cobe will be run

Rapid account: Jayeshjagtap 2711
jayeshjagtap2711 Commented 5 months ago

Thanks brother code is really working

Rapid account: Zinmazh
zinmazh Commented 6 months ago

thanks a lot,it did work perfectly

Rapid account: Rakhattri
Rakhattri Commented 10 months ago

Thanks man, your code did the job for me.

Rapid account: Aniketk 8600
aniketk8600 Commented a year ago

Your code is working fine thanks!, But when i m using code snippet of js fetch it showed error why?

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

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