New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

weather-au-api

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weather-au-api

NodeJS library for accessing api.weather.bom.gov.au

  • 0.5.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

weather-au-api

GitHub Workflow Status (branch) GitHub package.json version GitHub license

NodeJS API library for accessing api.weather.bom.gov.au

This API is inspired by tonyallan/weather-au.

As the API is reversed engineered from the usage in https://weather.bom.gov.au with no information about future access arrangements or availability, use this module as your own risks.

Installation

Through npm:

npm install weather-au-api

Through yarn:

yarn install weather-au-api

Example Usage

let Api = require('weather-au-api');
let api = new Api();
# Set your current location
api.search('3053');
# Retrieve the daily forecasts for the next 7 days
let resp = await api.forecasts_daily();
console.log(resp)

Usage

Set the geohash (optional)

api = new Api(geohash)

When initialising a new Api object, a geohash can be optionally provided. This will bypass the need to use the search() function to set location.

# Set the location to Carlton, VIC
api = new Api('r1r0fyd');

Set the search location

api.search(string)

Search by post code or location string and set the geohash location to first location returned through the API. When searching using location string, join the terms with +. Return a JSON list of locations found.

carlton = await api.search('3053');
console.log(carlton.data);
carlton2 = await api.search('Carlton+VIC');
console.log(carlton2);

Get the daily forecasts

api.forecasts_daily()

Get bom.gov.au daily forecasts for the next 7-8 days. A geohash must be set when initialising or through running api.search(). Return a JSON list of daily forecasts.

forecasts = await api.forecasts_daily();
console.log(forecasts);

Get warnings

api.warnings()

Get bom.gov.au current warnings. Might be empty if there is no warnings for current location. A geohash must be previously set. Return a JSON list of warnings.

warnings = await api.warnings();
console.log(warnings);

Get specific warning

api.warning(warning_id)

Get the warning with warning_id. Get warning_id from api.warnings(). Return a JSON object.

warning = await api.warning('VIC_RC022_IDV36310');
console.log(warning);

Get observations reading

api.observations()

Get the observations reading for the current location. Return a JSON object.

observations = await api.observations();
console.log(observations);

Get last response timestamp

api.response_timestamp()

Get the last response timestamp.

timestamp = api.response_timestamp()

Keywords

FAQs

Package last updated on 19 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc