RapidAPI #3 - Open Weather Wap (on Timer, with Params)
@tod
code:
data:privatelast updated:2 years agoarchived
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 800,000+ developers using the Pipedream platform
steps.
trigger
Cron Scheduler
Deploy to configure a custom schedule
This workflow runs on Pipedream's servers and is triggered on a custom schedule.
steps.
weather
auth
to use OAuth tokens and API keys in code via theauths object
(auths.rapidapi)
params
Q
London,uk
string ·params.q
Lat
0
string ·params.lat
Lon
0
string ·params.lon
Callback
test
string ·params.callback
Id
2172797
string ·params.id
Lang
null
string ·params.lang
Units
imperial
string ·params.units
Mode
xml
string ·params.mode
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps, params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
}
29
// Example - https://rapidapi.com/community/api/open-weather-map/

const axios = require("axios");

// Make an HTTP GET request using axios
const resp = await axios({
  method: 'GET',
  url: 'https://community-open-weather-map.p.rapidapi.com/weather',
  params: {
    q: params.q,
    lat: params.lat,
    lon: params.lon,
    callback: params.callback,
    id: params.id,
    lang: params.lang,
    units: params.units,
    mode: params.mode
  },
  headers: {
    'x-rapidapi-host': 'community-open-weather-map.p.rapidapi.com',
    'x-rapidapi-key': `${auths.rapidapi.api_key}`
  },
});

const { data } = resp;
return data