Weather Scraper
Try for free
3 days trial then $15.00/month - No credit card required now
View all Actors
Weather Scraper
epctex/weather-scraper
Try for free
3 days trial then $15.00/month - No credit card required now
Get data about weather forecasts or analyze conditions in any location in the world. This scraper downloads information about forecasts, humidity, temperature, wind, etc. and delivers it in HTML, JSON, XLSX, and more.
The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn mode
Node.js
Python
curl
1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4const client = new ApifyClient({
5 token: '<YOUR_API_TOKEN>',
6});
7
8// Prepare Actor input
9const input = {
10 "startUrls": [
11 {
12 "url": "https://weather.com/weather/today/l/5aea1d50a6d6b9e99cf89ba79f463d67dcf21ea5061990aae1ffc1c7fa8911a9"
13 },
14 {
15 "url": "https://weather.com/weather/today/l/ada030b2de8db495da2d93d5a2ecf30de1ce8b54cb09725d19c803543685646d"
16 }
17 ],
18 "locations": [
19 "Montgomery, Alabama",
20 "Juneau, Alaska"
21 ],
22 "locationIds": [
23 "e60256f3426acd3c1b3380921210fcffeab628a120c41d1de03b59a0f0dd32ad",
24 "bf217d537cc1c8074ec195ce07fb74de3c1593caa6033b7c3be4645ccc5b01de"
25 ],
26 "timeFrame": "today",
27 "units": "imperial",
28 "maxItems": 10,
29 "proxyConfiguration": {
30 "useApifyProxy": true
31 },
32 "extendOutputFunction": ($) => { return {} },
33 "customMapFunction": (object) => { return {...object} }
34};
35
36(async () => {
37 // Run the Actor and wait for it to finish
38 const run = await client.actor("epctex/weather-scraper").call(input);
39
40 // Fetch and print Actor results from the run's dataset (if any)
41 console.log('Results from dataset');
42 const { items } = await client.dataset(run.defaultDatasetId).listItems();
43 items.forEach((item) => {
44 console.dir(item);
45 });
46})();