{"id":22347510,"url":"https://github.com/chand1012/weather-api-worker","last_synced_at":"2026-05-09T14:41:16.820Z","repository":{"id":39983004,"uuid":"262471477","full_name":"chand1012/weather-api-worker","owner":"chand1012","description":"Middleware for https://api.weather.gov/","archived":false,"fork":false,"pushed_at":"2023-05-01T10:56:59.000Z","size":23,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T12:12:09.704Z","etag":null,"topics":["cloudflare-workers","javascript","nodejs","webpack"],"latest_commit_sha":null,"homepage":"https://weather.chand1012.workers.dev/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chand1012.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-09T02:25:30.000Z","updated_at":"2021-06-14T17:55:56.000Z","dependencies_parsed_at":"2023-01-31T21:30:30.424Z","dependency_job_id":null,"html_url":"https://github.com/chand1012/weather-api-worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chand1012%2Fweather-api-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chand1012%2Fweather-api-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chand1012%2Fweather-api-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chand1012%2Fweather-api-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chand1012","download_url":"https://codeload.github.com/chand1012/weather-api-worker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245641317,"owners_count":20648637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare-workers","javascript","nodejs","webpack"],"created_at":"2024-12-04T10:09:40.138Z","updated_at":"2026-05-09T14:41:16.766Z","avatar_url":"https://github.com/chand1012.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather Worker\n\nThis was a simple project meant for me to teach myself how to use a serverless system, in this case [Cloudflare Workers](https://workers.cloudflare.com/). This acts as middle ware for `https://api.weather.gov/`, so it will only work for the US and its territories.\n\n# To use\n\nSimply submit a `POST` request to the url at `https://weather-api.chand1012.workers.dev/`. Here is a cURL example:\n\n`curl -XPOST -H \"Content-type: application/json\" -d '{\"lat\": 38.9, \"lng\": -77}' 'https://weather-api.chand1012.workers.dev'`\n\nPython Example:\n\n```Python\nimport requests\n\nlat = 41\nlng = -71\n\nreq = requests.post(\"https://weather-api.chand1012.workers.dev/\", headers={'content-type':'application/json'}, json={'lat':lat, 'lng':lng})\n\nprint(req.json())\n```\n\nThis will return the forecasts for the next 7 days for the given forecast. If you want a simple python class with functions to work with this, here is the snippet of code I use for my [Discord Weather Bot](https://github.com/chand1012/discord-weather-bot):\n\n```Python\nclass WorkerWeatherSearch():\n    def __init__(self):\n        self.lat = 41.08\n        self.lng = -81.51\n        self.base_url = \"https://weather-api.chand1012.workers.dev\"\n        self.json = None\n        self.forecasts = []\n\n    def search(self, lat, lng):\n        self.lat = lat\n        self.lng = lng\n        req = requests.post(self.base_url, headers={'content-type':'application/json'}, json={'lat':lat, 'lng':lng})\n        self.json = req.json()\n        self.forecasts = self.json['properties']['periods']\n        return self.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchand1012%2Fweather-api-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchand1012%2Fweather-api-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchand1012%2Fweather-api-worker/lists"}