inetstudio / webmaster.api
Yandex Webmaster Api v4.1 library
Requires
- php: ^7.4 || ^8.0 || 8.1 || ^8.3
- ext-curl: *
- ext-json: *
Requires (Dev)
This package is auto-updated.
Last update: 2026-03-01 00:43:52 UTC
README
Installation
Composer
add into composer.json
{ "require": { ... "hardworm/webmaster.api": "1.4.*" ... } }
or
php composer.phar require hardworm/webmaster.api "dev-master"
Also required prior to placing the package on packagist.libfun.net
...
"repositories": [
{
"type": "vcs",
"url": "https://github.com/hardworm/webmaster.api"
}
]
...
Manual
Clone repository and require webmasterApi.php
Usage
How to use example:
-
Before use this code go to https://oauth.yandex.ru/client/new and add new client
-
Create file "example/config.php" by copy "config.example.php". Add client ID and secret code here to use example
How to use webmasterApi class:
-
Add client on https://oauth.yandex.ru/client/new page. Don't forget to set up correct return url
-
For test you can get temporary Access Token (read comments to method webmasterApi::getAccessToken )
-
If you want to get correct Access Token, you must create authorization code.
- Read doc on https://tech.yandex.ru/oauth/doc/dg/reference/web-client-docpage/
- Locate your client to https://oauth.yandex.ru/authorize?response_type=code&client_id=[yourclient_id]
- Use static method getAccessToken to get access token
- Create webmasterApi object with static method webmasterApi::initApi
You can see example/.auth.php to see how it working
- Enjoy!
Methods
addHostaddOriginalTextaddQueueRecrawladdSitemapcheckVerificationcurlOptsdataToStringdeletedeleteHostdeleteOriginalTextdeleteSitemaperrorCriticalgetgetAccessTokengetApiUrlgetDiagnosticsgetHostInfogetHostOwnersgetHostSitemapsgetHostSummarygetHostUserSitemapsgetHostsgetIndexingHistorygetIndexingSamplesgetOriginalTextsgetPopularQueriesgetQueueRecrawlgetQuotaRecrawlgetSearchUrlHistorygetSearchUrlSamplesgetSearchUrlEventHistorygetSearchUrlEventHistorySamplesgetSqiHistorygetStateRecrawlQueuegetUserIDinitApipostverifyHost