churakovmike/accuweather-client

Accuweather php client

dev-master 2020-08-09 17:12 UTC

This package is auto-updated.

Last update: 2024-04-10 00:52:18 UTC


README

Requirement

  • PHP >=7.0

Installation

composer require churakovmike/accuweather-client

or with composer.phar

php composer.phar require churakovmike/accuweather-client

Usage

Initialize api client in your code.

use ChurakovMike\Accuweather\Client\Client;

$client = new Client([
    'apiKey' => 'your-api-key',
]);

You can set your api key later:

use ChurakovMike\Accuweather\Client\Client;

$client = new Client();
$client->setApikey('your-api-key');

API Reference

Locations API

Forecast API

Current Conditions API

  • Current Conditions
$client->currentCondition()->get($countryCode, $language, $details);
  • Current Conditions for Top Cities
$client->getTopCitiesCondition()->get($group, $language);
  • Historical Current Conditions (past 24 hours)
$client->getHistorical()->get($countryCode, $language, $details);
  • GETHistorical Current Conditions (past 6 hours)
$client->getHistoricalPast()->get($countryCode, $language, $details);

Indices API

Weather Alarms API

  • 1 Day of Weather Alarms
$client->weatherAlarm()->get1day($countryCode, $language);
  • 10 Days of Weather Alarms
$client->weatherAlarm()->get10day($countryCode, $language);
  • GET15 Days of Weather Alarms
$client->weatherAlarm()->get15day($countryCode, $language);
  • GET5 Days of Weather Alarms
$client->weatherAlarm()->get5day($countryCode, $language);

Alerts API

  • Alerts by LocationKey
$client->alert()->get($countryCode, $language, $details);

Imagery API

  • GETRadar and Satellite Imagery
$client->imagery()->get($resolution, $countryCode, $language);

Tropical API

  • Active government-issued storms by basin ID and government ID
$client->tropical()->getActiveStormSpecify($basinID, $governmentId);
  • Active government-issued storms
$client->tropical()->getActiveStorm();
  • Search government-issued storms by year and basin ID
$client->tropical()->search($year, $basinId);
  • Search government-issued storms by year, basin ID, and government ID
$client->tropical()->extendedSearch($year, $basinId, $governmentId);
  • Active government-issued storms by basin ID
$client->tropical()->getStormByBasinId($basinId);
  • Positions for an individual government-issued storm
$client->tropical()->getStormPosition($year, $basinId, $governmentId, $details, $geometry, $includeLandmarks);
  • Current position for an individual government-issued storm
$client->tropical()->getStormCurrentPosition($year, $basinId, $governmentId, $details, $geometry, $includeLandmarks);
  • Government-issued forecasts
$client->tropical()->getGovernmentForecast($year, $basinId, $governmentId, $details, $geometry, $windowGeometry);
  • Tropical cyclone forecasts (deprecated)
$client->tropical()->getCycloneForecast($year, $basinId, $depressionId);

Translations API

  • List all Languages - Returns metadata for all languages.
$client->translation()->getLanguages();
  • List of Available Translation Groups - Lists groups of phrases that are available for translation.
$client->translation()->getTranslationGroups();
  • List of Translations for a Specific Group - Returns all translated phrases for a specific group, in the desired language.
$client->translation()->getTranslationByGroup();