seoapi-ru / api-client-php
Public API PHP client
dev-master
2019-06-20 17:22 UTC
Requires
- php: ^7.1.3
- ext-json: *
- ext-zlib: *
- guzzlehttp/guzzle: ^6.0.0
- symfony/http-client: 4.3.*
Requires (Dev)
- fzaninotto/faker: ^1.8
- justinrainbow/json-schema: ^5.0.0
- league/uri: ^5.3.0
- phpunit/phpunit: ^7.0.0
- symfony/dotenv: ^4.0.0
This package is not auto-updated.
Last update: 2025-03-12 15:56:18 UTC
README
Usage
Install the client with Composer:
composer require seoapi-ru/api-client-php
Create client with username and password to authenticate:
$client = ApiClient::fromCredentials( 'username', 'password', new HttpClientFactory() );
...or using predefined session token.
// ... first steps: see previous example $client = ApiClient::fromToken(self::VALID_TOKEN, self::BASE_URL, new HttpClientFactory());
Use client methods to call API counterparts.
$regions = $client->getRegions('москва'); $stats = $client->getDailyStatsReport('google', 2019, 2); // etc, see tests
For expected JSON response formats refer JSON schemas located at tests/Functional/**.*Test.php