getWeathers(params: IGetWeathers)

Requires:
@ray-js/ray≥1.5.2

Description

Get weather forecast information

Parameters

ParameterTypeRequiredDescription
YesRequest parameters

Return Value

Type: Promise<IGetWeathersResponse>
Weather forecast information, including city info and multi-day weather data (temperature, humidity, wind direction, wind speed, sunrise/sunset times, etc.)

Examples

Basic usage

import { getWeathers } from '@ray-js/ray';

getWeathers({
  devId: 'vdevo169477319679442',
  dataRange: 7,
}).then((res) => {
  console.log('Weather forecast:', res);
}).catch((error) => {
  console.error(error);
});