ballerinax/openweathermap Ballerina library

1.1.0

Overview

This is a generated connector from Open Weather Map API v2.5 OpenAPI Specification.

The Open Weather Map API provides access to current weather data and weather forecast of any location worldwide including 200,000 cities by consuming the Current Weather Data and One Call API endpoints.

Prerequisites

  • Create OpenWeatherMap account.
    • Choose a subscription that matches with your requirements
  • Obtain Api Key

Quickstart

To use the Open Weather Map connector in your Ballerina application, update the .bal file as follows:

Step 1: Import connector

Copy
import ballerinax/openweathermap;

Step 2: Create a new connector instance

Provide the obtained API Key in client configuration.

Copy
ApiKeysConfig config = {
    appid : "<your appid>"
}

openweathermap:Client openweatherClient = check new openweathermap:Client(config);

Step 3: Invoke connector operation

  1. Obtain current weather data by city name.
Copy
CurrentWeatherData result = check weatherclient->getCurretWeatherData("Colombo");
log:printInfo("Colombo Current Weather data : " + result.toString());
  1. Use bal run command to compile and run the Ballerina program.

Import

import ballerinax/openweathermap;Copy

Metadata

Released date: almost 3 years ago

Version: 1.1.0

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: slbeta6

GraalVM compatible: Yes


Pull count

Total: 5070

Current verison: 105


Weekly downloads


Source repository


Keywords

Lifestyle & Entertainment/News & Lifestyle

Cost/Freemium


Contributors

Other versions

See more...