xvilo / harvest-forecast
Harvest Forecast API client
Installs: 2 157
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 4
Open Issues: 1
Requires
- php: ^7.2|^8.0
- php-http/cache-plugin: ^1.4
- php-http/client-common: ^1.6 || ^2.0
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.0
- php-http/httplug: ^1.1 || ^2.0
- psr/cache: ^1.0
- psr/http-message: ^1.0
Requires (Dev)
- cache/array-adapter: ^1.1.0
- friendsofphp/php-cs-fixer: ^3.0
- guzzlehttp/psr7: ^1.2
- php-http/guzzle6-adapter: ^1.0 || ^2.0
- php-http/mock-client: ^1.2
- phpunit/phpunit: ^7.0 || ^8.0
This package is auto-updated.
Last update: 2025-05-08 17:11:24 UTC
README
A Forecast API Wrapper, please note that there is currently no official public API. However this API client has been made by inspecting network traffic from their web client.
Installation
You can install this package through composer, the easiest way is to:
composer require xvilo/harvest-forecast
You will also need an implementation of php-http/client-implementation
.
Getting Started
You will need an API access token, you can obtain one from Harvest Developers. Please create a new access token and save this.
Usage
<?php declare(strict_types=1); // This file is generated by Composer require_once __DIR__ . '/vendor/autoload.php'; // Create Client Instance $client = new \Harvest\Forecast\Client(); // Authenticate $client->authenticate('1622120.xx._xyzabcdefghijklmnopqrstuvw', 123456); // Call endpoint $whoAmI = $client->user->whoAmI(); echo json_encode ( $whoAmI, JSON_PRETTY_PRINT );
FAQ
php-http/client-implementation needed
If you try to install this package and get the following error:
xvilo/harvest-forecast 1.0.0 requires php-http/client-implementation ^1.0 -> no matching package found
Please install a PHP HTTP library such as Guzzle or Symfony HttpClient Component:
composer require symfony/http-client
or
composer require php-http/guzzle6-adapter