mariusasensi/meteocat-api-php-client

API client for Meteocat REST API

1.0 2019-08-12 19:06 UTC

This package is auto-updated.

Last update: 2024-09-19 03:54:31 UTC


README

Build Status Software License Code Coverage Quality Score Total Downloads

An unofficial PHP client for easy use of the Meteo.cat API REST.

Documentation of the API can be found at https://apidocs.meteocat.gencat.cat/documentacio/.

As the documentation indicates, to use this provider it is necessary to request the access token from this form.

About the provider

Installation

Use Composer:

$ composer require mariusasensi/meteocat-api-php-client

Usage

use Meteocat\Provider\Meteocat;
use Meteocat\Model\Query\Forecast\Forecasting\GetCatalunyaByDate;
use Meteocat\Model\Entity\Forecast;

$client = new Meteocat('your_api_token');
$query = new GetCatalunyaByDate(DateTime::createFromFormat('Y-m-d', '2019-08-06'));

/** @var Forecast $entityResponse */
$response = $client->executeQuery($query);

Operation query types

License

The MIT License (MIT). Please see License File for more information.