Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BoM Beta Website API #235

Open
ArrEssJay opened this issue Jul 28, 2024 · 2 comments
Open

BoM Beta Website API #235

ArrEssJay opened this issue Jul 28, 2024 · 2 comments
Labels
future Something to consider in the future

Comments

@ArrEssJay
Copy link

ArrEssJay commented Jul 28, 2024

Not so much an issue... I see the BoM beta website is using (yet another) more comprehensive JSON-based API. This appears to provide additional data e.g. air pressure where available, also at 10 minute intervals. I had a trawl through the issue list and saw no mention of this.

In all requests ensure user agent is set to something browser-like.

Selecting your location in https://beta.bom.gov.au/ will query a number of API endpoints either for some defaults or for your determined lat/lon position.

Get forecast/fire/flood/coastal district and nearest stations for a location:
https://api.beta.bom.gov.au/apikey/v1/locations/places/search?coordinate={lon},{lat}&filter=type:place,nearby_type:bom_stn&radius=100000&website-sort=true&website-filter=true

Get list of forecast districts/forecast IDs:
https://beta.bom.gov.au/config/towns_places/towns-cities.json

Daily Forecast:
https://api.beta.bom.gov.au/apikey/v1/forecasts/daily-list/2024-07-28?place_id={FORECAST_ID}

Detailed/Summary Forecast:
https://api.beta.bom.gov.au/apikey/v1/forecasts/apikey/v1/forecasts/texts?aac={FORECAST_ID}&aac={FORECAST_ID_2}&timezone={timezone}

Where timezone is in TZ format eg. 'Australia/Melbourne'

Single station latest observations:
https://api.beta.bom.gov.au/apikey/v1/observations/latest/{bom_station_no}/atm/surf_air?include_qc_results=false

List-of-Stations latest observations:
https://api.beta.bom.gov.au/apikey/v1/observations/latest-list/atm/surf_air?bom_stn_num={bom_station_no_1}&bom_stn_num={bom_station_no_n}&include_qc_results=false

Warnings:
https://api.beta.bom.gov.au/apikey/v1/warnings/list?area_type=coordinate&area_code={lon},{lat}

Sunrise/Sunset:
https://api.beta.bom.gov.au/apikey/v1/forecasts/astro/{lon}/{lat}

time-series map tiles for radar/temp etc are retrieved from ArcGIS Server:
https://api.beta.bom.gov.au/apikey/v1/mapping/overlays/towns_and_cities/FeatureServer?f=pjson
https://api.beta.bom.gov.au/apikey/v1/mapping/basemaps/basemap_default/MapServer/tile/9/313/460
https://api.beta.bom.gov.au/apikey/v1/mapping/timeseries/wmts/1.0.0/atm_surf_air_precip_rate_1hr_total_mm_h/default/2024-07-28T14:00Z/GoogleMapsCompatible_BoM/8/25/29.png

This appears to be behind a proxy - most ArcGIS/WMTS queries 404

There are likely more endpoints - I didn't perform an exhaustive exploration.

Will they change it? Will they block your IP if you use it? Who knows. I'll probably use Telegraf to poll the json and pass it into home assistant via MQTT for now, but perhaps it will prove useful in the custom component too.

@Makin-Things Makin-Things added the future Something to consider in the future label Jul 29, 2024
@Makin-Things
Copy link
Collaborator

Thanks @ArrEssJay for the heads up.
This is very similar to the current api, but with lots more data made available. The current api is used by the mobile app, but for quite a long time there was also a beta version available at the same url that they are now reusing (they removed it about 2 years ago).
While they have the word beta in the api url I think it would not be wise to commit resources to developing new code to use it. It is a real shame that they are continuing down the path of polling for updates (if you watch in the dev tools you will see it polls the warning api every 60 seconds to get the same response 99.9999% of the time). Why not use websockets to push updates, it is 2024 after all so that is no longer bleeding edge tech.
I tried to use the give feedback option, but alas something as important as that does not function.

I will leave this issue open for others to share their thoughts.

@ArrEssJay
Copy link
Author

ArrEssJay commented Jul 29, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future Something to consider in the future
Projects
None yet
Development

No branches or pull requests

2 participants