![Weather Scraper avatar](https://images.apifyusercontent.com/V6vwfuKrxwAtprKKya9emamcyNdcjyRTqiBPzs-ReRo/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS91dHp0S3kwRmVaQnRKeWh4OC9TdkVpa3RUcnlqZ2piTTRxbi0xMjAwcHgtVGhlX1dlYXRoZXJfQ2hhbm5lbF9sb2dvXzIwMDUtcHJlc2VudC5zdmcucG5n.webp)
Weather Scraper
Try for free
3 days trial then $10.00/month - No credit card required now
View all Actors![Weather Scraper](https://images.apifyusercontent.com/V6vwfuKrxwAtprKKya9emamcyNdcjyRTqiBPzs-ReRo/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS91dHp0S3kwRmVaQnRKeWh4OC9TdkVpa3RUcnlqZ2piTTRxbi0xMjAwcHgtVGhlX1dlYXRoZXJfQ2hhbm5lbF9sb2dvXzIwMDUtcHJlc2VudC5zdmcucG5n.webp)
![Weather Scraper](https://images.apifyusercontent.com/V6vwfuKrxwAtprKKya9emamcyNdcjyRTqiBPzs-ReRo/rs:fill:250:250/aHR0cHM6Ly9hcGlmeS1pbWFnZS11cGxvYWRzLXByb2QuczMuYW1hem9uYXdzLmNvbS91dHp0S3kwRmVaQnRKeWh4OC9TdkVpa3RUcnlqZ2piTTRxbi0xMjAwcHgtVGhlX1dlYXRoZXJfQ2hhbm5lbF9sb2dvXzIwMDUtcHJlc2VudC5zdmcucG5n.webp)
Weather Scraper
epctex/weather-scraper
Try for free
3 days trial then $10.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 more
1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4client = ApifyClient("<YOUR_API_TOKEN>")
5
6# Prepare the Actor input
7run_input = {
8 "startUrls": [
9 { "url": "https://weather.com/weather/today/l/5aea1d50a6d6b9e99cf89ba79f463d67dcf21ea5061990aae1ffc1c7fa8911a9" },
10 { "url": "https://weather.com/weather/today/l/ada030b2de8db495da2d93d5a2ecf30de1ce8b54cb09725d19c803543685646d" },
11 ],
12 "locations": [
13 "Montgomery, Alabama",
14 "Juneau, Alaska",
15 ],
16 "locationIds": [
17 "e60256f3426acd3c1b3380921210fcffeab628a120c41d1de03b59a0f0dd32ad",
18 "bf217d537cc1c8074ec195ce07fb74de3c1593caa6033b7c3be4645ccc5b01de",
19 ],
20 "timeFrame": "today",
21 "units": "imperial",
22 "maxItems": 10,
23 "proxyConfiguration": { "useApifyProxy": True },
24 "extendOutputFunction": "($) => { return {} }",
25 "customMapFunction": "(object) => { return {...object} }",
26}
27
28# Run the Actor and wait for it to finish
29run = client.actor("epctex/weather-scraper").call(run_input=run_input)
30
31# Fetch and print Actor results from the run's dataset (if there are any)
32print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
33for item in client.dataset(run["defaultDatasetId"]).iterate_items():
34 print(item)
35
36# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start