{"id":3583,"date":"2019-07-19T17:35:27","date_gmt":"2019-07-19T17:35:27","guid":{"rendered":"https:\/\/zankovich-com.sr-srv.net\/?p=2578"},"modified":"2024-01-10T13:42:22","modified_gmt":"2024-01-10T13:42:22","slug":"api-beginning-of-work","status":"publish","type":"post","link":"https:\/\/seranking.com\/ru\/api-beginning-of-work.html","title":{"rendered":"\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API"},"content":{"rendered":"<h2 id=\"anchor1\">\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c API-\u043a\u043b\u044e\u0447 \u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f SE Ranking. API-\u043a\u043b\u044e\u0447 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 token \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u043b\u0438 \u0432 HTTP-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 Authorization.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 API \u0432\u044b\u0437\u0432\u0430\u043d \u0431\u0435\u0437 API-\u043a\u043b\u044e\u0447\u0430 \u0438\u043b\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 API-\u043a\u043b\u044e\u0447, \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u201cno token\u201d \u0438\u043b\u0438 \u201cincorrect token\u201d.<\/p>\n<h2 id=\"anchor2\">\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 API-\u043a\u043b\u044e\u0447\u0430<\/h2>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f API:<\/p>\n<ol>\n<li>\u0412\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f;<\/li>\n<li>\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 -&gt; API;<\/li>\n<li>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 &#8220;\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c API-\u043a\u043b\u044e\u0447&#8221;.<\/li>\n<\/ol>\n<h2 id=\"anchor3\">\u0412\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/h2>\n<p>\u0412\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 API \u0438\u0434\u0451\u0442 \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 HTTPS. \u0412\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 API \u2014 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b GET\/POST\/PUT\/DELETE \u043a URL:<\/p>\n<div class=\"se-code-block\" data-tooltip=\"&lt;pre&gt;&lt;code&gt;https:\/\/api4.seranking.com\/&lt;\/code&gt;&lt;\/pre&gt;\"><div class=\"se-code-block-inner\"><div class=\"se-code-block-bar\"><div class=\"se-code-block__copy-btn se-btn_text se-btn se-btn_tert\"><div class=\"se-btn__icon-container\"><i class=\"se-btn__icon-fill copy\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M7.91602 14.1668C7.57227 14.1668 7.27799 14.0444 7.0332 13.7996C6.78841 13.5548 6.66602 13.2606 6.66602 12.9168V4.5835C6.66602 4.23975 6.78841 3.94548 7.0332 3.70068C7.27799 3.45589 7.57227 3.3335 7.91602 3.3335H14.5827C14.9264 3.3335 15.2207 3.45589 15.4655 3.70068C15.7103 3.94548 15.8327 4.23975 15.8327 4.5835V12.9168C15.8327 13.2606 15.7103 13.5548 15.4655 13.7996C15.2207 14.0444 14.9264 14.1668 14.5827 14.1668H7.91602ZM7.91602 12.9168H14.5827V4.5835H7.91602V12.9168ZM5.41602 16.6668C5.07227 16.6668 4.77799 16.5444 4.5332 16.2996C4.28841 16.0548 4.16602 15.7606 4.16602 15.4168V5.8335H5.41602V15.4168H13.3327V16.6668H5.41602Z\" fill=\"#101423\"\/>\n<\/svg>\n<\/i><i class=\"se-btn__icon-fill check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M8.10417 14.4375L4.0625 10.4167L5.125 9.33333L8.10417 12.3125L14.875 5.5625L15.9375 6.625L8.10417 14.4375Z\" fill=\"#101423\"\/>\n<\/svg>\n<\/i><\/div>Copy<\/div><\/div><div class=\"se-code-block__content\"><pre><code>https:\/\/api4.seranking.com\/<\/code><\/pre><\/div><\/div><\/div>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0438 \u0432\u044b\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 UTF-8. \u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0442\u0435\u043b\u0435 POST\/PUT \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 JSON.<\/p>\n<p>\u041f\u0440\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f HTTP \u043a\u043e\u0434 2xx.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f HTTP 4xx \u0438\u043b\u0438 HTTP 5xx \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<div class=\"se-tabber\"><br \/>\n<div class=\"se-tabber__title\"><button class=\"se-tabber__toggle\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b (curl)<\/button><\/div><div class=\"se-tabber__item\"><br \/>\n<div class=\"se-code-block\" data-tooltip=\"&lt;pre&gt;&lt;code&gt;curl -X GET &quot;https:\/\/api4.seranking.com\/account\/balance&quot; -H &quot;Authorization: Token be2165b7d065e278e7305c1c7ef791f283f5d14b&quot;&lt;br \/&gt;\nHTTP\/1.0 200 OK&lt;br \/&gt;\nContent-Type: application\/json&lt;br \/&gt;\n{&quot;currency&quot;:&quot;rur&quot;,&quot;value&quot;:2296380.85}&lt;br \/&gt;\n------&lt;br \/&gt;\ncurl -X GET &quot;https:\/\/api4.seranking.com\/api\/sites&quot;&lt;br \/&gt;\nHTTP\/1.0 403 Forbidden&lt;br \/&gt;\nContent-Type: application\/json&lt;br \/&gt;\n{&quot;message&quot;:&quot;No token&quot;}&lt;br \/&gt;\n------&lt;br \/&gt;\ncurl -X POST &quot;https:\/\/api4.seranking.com&quot; -H &quot;Authorization: Token be2165b7d065e278e7305c1c7ef791f283f5d14b&quot; -d &quot;{\\&quot;url\\&quot;:\\&quot;https:\/\/example.com\\&quot;,\\&quot;title\\&quot;:\\&quot;example1\\&quot;}&quot;&lt;br \/&gt;\nHTTP\/1.0 201 Created&lt;br \/&gt;\nContent-Type: application\/json&lt;br \/&gt;\n{&quot;site_id&quot;:147696}&lt;\/code&gt;&lt;\/pre&gt;\"><div class=\"se-code-block-inner\"><div class=\"se-code-block-bar\"><div class=\"se-code-block__copy-btn se-btn_text se-btn se-btn_tert\"><div class=\"se-btn__icon-container\"><i class=\"se-btn__icon-fill copy\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M7.91602 14.1668C7.57227 14.1668 7.27799 14.0444 7.0332 13.7996C6.78841 13.5548 6.66602 13.2606 6.66602 12.9168V4.5835C6.66602 4.23975 6.78841 3.94548 7.0332 3.70068C7.27799 3.45589 7.57227 3.3335 7.91602 3.3335H14.5827C14.9264 3.3335 15.2207 3.45589 15.4655 3.70068C15.7103 3.94548 15.8327 4.23975 15.8327 4.5835V12.9168C15.8327 13.2606 15.7103 13.5548 15.4655 13.7996C15.2207 14.0444 14.9264 14.1668 14.5827 14.1668H7.91602ZM7.91602 12.9168H14.5827V4.5835H7.91602V12.9168ZM5.41602 16.6668C5.07227 16.6668 4.77799 16.5444 4.5332 16.2996C4.28841 16.0548 4.16602 15.7606 4.16602 15.4168V5.8335H5.41602V15.4168H13.3327V16.6668H5.41602Z\" fill=\"#101423\"\/>\n<\/svg>\n<\/i><i class=\"se-btn__icon-fill check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M8.10417 14.4375L4.0625 10.4167L5.125 9.33333L8.10417 12.3125L14.875 5.5625L15.9375 6.625L8.10417 14.4375Z\" fill=\"#101423\"\/>\n<\/svg>\n<\/i><\/div>Copy<\/div><\/div><div class=\"se-code-block__content\"><pre><code>curl -X GET \"https:\/\/api4.seranking.com\/account\/balance\" -H \"Authorization: Token be2165b7d065e278e7305c1c7ef791f283f5d14b\"<br \/>\nHTTP\/1.0 200 OK<br \/>\nContent-Type: application\/json<br \/>\n{\"currency\":\"rur\",\"value\":2296380.85}<br \/>\n------<br \/>\ncurl -X GET \"https:\/\/api4.seranking.com\/api\/sites\"<br \/>\nHTTP\/1.0 403 Forbidden<br \/>\nContent-Type: application\/json<br \/>\n{\"message\":\"No token\"}<br \/>\n------<br \/>\ncurl -X POST \"https:\/\/api4.seranking.com\" -H \"Authorization: Token be2165b7d065e278e7305c1c7ef791f283f5d14b\" -d \"{\\\"url\\\":\\\"https:\/\/example.com\\\",\\\"title\\\":\\\"example1\\\"}\"<br \/>\nHTTP\/1.0 201 Created<br \/>\nContent-Type: application\/json<br \/>\n{\"site_id\":147696}<\/code><\/pre><\/div><\/div><\/div><br \/>\n<\/div><br \/>\n<div class=\"se-tabber__title\"><button class=\"se-tabber__toggle\">PHP \u041f\u0440\u0438\u043c\u0435\u0440\u044b (file_get_contents)<\/button><\/div><div class=\"se-tabber__item\"><br \/>\n<div class=\"se-code-block\" data-tooltip=\"&lt;pre&gt;&lt;code&gt;$apiKey = &#039;API_KEY&#039;;&lt;br \/&gt;\n$url = &#039;https:\/\/api4.seranking.com\/sites&#039;;&lt;br \/&gt;\n$context = stream_context_create([&lt;br \/&gt;\n&#039;http&#039; =&gt; [&lt;br \/&gt;\n&#039;method&#039; =&gt; &#039;POST&#039;,&lt;br \/&gt;\n&#039;ignore_errors&#039; =&gt; true,&lt;br \/&gt;\n&#039;header&#039; =&gt; [&lt;br \/&gt;\n&quot;Authorization: Token $apiKey&quot;,&lt;br \/&gt;\n&quot;Content-Type: application\/json; charset=utf-8&quot;&lt;br \/&gt;\n],&lt;br \/&gt;\n&#039;content&#039; =&gt; json_encode([&lt;br \/&gt;\n&#039;url&#039; =&gt; &#039;https:\/\/example.com&#039;,&lt;br \/&gt;\n&#039;title&#039; =&gt; &#039;my test project&#039;&lt;br \/&gt;\n])&lt;br \/&gt;\n]&lt;br \/&gt;\n]);&lt;br \/&gt;\n$httpStatus = null;&lt;br \/&gt;\n$result = file_get_contents($url, 0, $context);&lt;br \/&gt;\nif (isset($http_response_header)) {&lt;br \/&gt;\npreg_match(&#039;`HTTP\/[0-9\\.]+\\s+([0-9]+)`&#039;, $http_response_header[0], $matches);&lt;br \/&gt;\n$httpStatus = $matches[1];&lt;br \/&gt;\n}&lt;br \/&gt;\nif (!$result) {&lt;br \/&gt;\necho &quot;&lt;b&gt;\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430&lt;\/b&gt;&lt;b&gt;!&lt;\/b&gt;&quot;;&lt;br \/&gt;\n} else {&lt;br \/&gt;\n$result = json_decode($result);&lt;br \/&gt;\nif (201 == $httpStatus) {&lt;br \/&gt;\necho $result-&gt;site_id;&lt;br \/&gt;\n} else {&lt;br \/&gt;\necho &#039;&lt;b&gt;\u041e\u0448\u0438\u0431\u043a\u0430&lt;\/b&gt;&#039;.$result-&gt;message;&lt;br \/&gt;\n}&lt;br \/&gt;\n}&lt;\/code&gt;&lt;\/pre&gt;\"><div class=\"se-code-block-inner\"><div class=\"se-code-block-bar\"><div class=\"se-code-block__copy-btn se-btn_text se-btn se-btn_tert\"><div class=\"se-btn__icon-container\"><i class=\"se-btn__icon-fill copy\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M7.91602 14.1668C7.57227 14.1668 7.27799 14.0444 7.0332 13.7996C6.78841 13.5548 6.66602 13.2606 6.66602 12.9168V4.5835C6.66602 4.23975 6.78841 3.94548 7.0332 3.70068C7.27799 3.45589 7.57227 3.3335 7.91602 3.3335H14.5827C14.9264 3.3335 15.2207 3.45589 15.4655 3.70068C15.7103 3.94548 15.8327 4.23975 15.8327 4.5835V12.9168C15.8327 13.2606 15.7103 13.5548 15.4655 13.7996C15.2207 14.0444 14.9264 14.1668 14.5827 14.1668H7.91602ZM7.91602 12.9168H14.5827V4.5835H7.91602V12.9168ZM5.41602 16.6668C5.07227 16.6668 4.77799 16.5444 4.5332 16.2996C4.28841 16.0548 4.16602 15.7606 4.16602 15.4168V5.8335H5.41602V15.4168H13.3327V16.6668H5.41602Z\" fill=\"#101423\"\/>\n<\/svg>\n<\/i><i class=\"se-btn__icon-fill check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M8.10417 14.4375L4.0625 10.4167L5.125 9.33333L8.10417 12.3125L14.875 5.5625L15.9375 6.625L8.10417 14.4375Z\" fill=\"#101423\"\/>\n<\/svg>\n<\/i><\/div>Copy<\/div><\/div><div class=\"se-code-block__content\"><pre><code>$apiKey = 'API_KEY';<br \/>\n$url = 'https:\/\/api4.seranking.com\/sites';<br \/>\n$context = stream_context_create([<br \/>\n'http' =&gt; [<br \/>\n'method' =&gt; 'POST',<br \/>\n'ignore_errors' =&gt; true,<br \/>\n'header' =&gt; [<br \/>\n\"Authorization: Token $apiKey\",<br \/>\n\"Content-Type: application\/json; charset=utf-8\"<br \/>\n],<br \/>\n'content' =&gt; json_encode([<br \/>\n'url' =&gt; 'https:\/\/example.com',<br \/>\n'title' =&gt; 'my test project'<br \/>\n])<br \/>\n]<br \/>\n]);<br \/>\n$httpStatus = null;<br \/>\n$result = file_get_contents($url, 0, $context);<br \/>\nif (isset($http_response_header)) {<br \/>\npreg_match('`HTTP\/[0-9\\.]+\\s+([0-9]+)`', $http_response_header[0], $matches);<br \/>\n$httpStatus = $matches[1];<br \/>\n}<br \/>\nif (!$result) {<br \/>\necho \"<b>\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/b><b>!<\/b>\";<br \/>\n} else {<br \/>\n$result = json_decode($result);<br \/>\nif (201 == $httpStatus) {<br \/>\necho $result-&gt;site_id;<br \/>\n} else {<br \/>\necho '<b>\u041e\u0448\u0438\u0431\u043a\u0430<\/b>'.$result-&gt;message;<br \/>\n}<br \/>\n}<\/code><\/pre><\/div><\/div><\/div><br \/>\n<\/div><br \/>\n<div class=\"se-tabber__title\"><button class=\"se-tabber__toggle\">PHP \u041f\u0440\u0438\u043c\u0435\u0440\u044b (curl)<\/button><\/div><div class=\"se-tabber__item\"><br \/>\n<div class=\"se-code-block\" data-tooltip=\"&lt;pre&gt;&lt;code&gt;$url = &#039;https:\/\/api4.seranking.com\/sites&#039;;&lt;br \/&gt;\n$token = &#039;API_KEY&#039;;&lt;br \/&gt;\n$curl = curl_init($url);&lt;br \/&gt;\ncurl_setopt_array($curl, [&lt;br \/&gt;\nCURLOPT_HTTPHEADER =&gt; [&#039;Authorization: Token &#039;.$token],&lt;br \/&gt;\nCURLOPT_HEADER =&gt; 0,&lt;br \/&gt;\nCURLOPT_RETURNTRANSFER =&gt; 1,&lt;br \/&gt;\nCURLOPT_POST =&gt;true,&lt;br \/&gt;\nCURLOPT_POSTFIELDS=&gt;json_encode([&lt;br \/&gt;\n&#039;url&#039; =&gt; &#039;https:\/\/example.com&#039;,&lt;br \/&gt;\n&#039;title&#039; =&gt; &#039;my new test project&#039;&lt;br \/&gt;\n])&lt;br \/&gt;\n]);&lt;br \/&gt;\n$content = curl_exec($curl);&lt;br \/&gt;\nif (!$content) {&lt;br \/&gt;\necho &quot;&lt;b&gt;\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430!&lt;\/b&gt;&quot;;&lt;br \/&gt;\n} else {&lt;br \/&gt;\n$info = curl_getinfo($curl);&lt;br \/&gt;\n$result = json_decode($content);&lt;br \/&gt;\nif (201 == $info[&#039;http_code&#039;]) {&lt;br \/&gt;\necho $result-&gt;site_id;&lt;br \/&gt;\n} else {&lt;br \/&gt;\necho &#039;&lt;b&gt;\u041e\u0448\u0438\u0431\u043a\u0430&lt;\/b&gt;&#039;.$result-&gt;message;&lt;br \/&gt;\n}&lt;br \/&gt;\n}&lt;br \/&gt;\n&lt;\/code&gt;&lt;\/pre&gt;\"><div class=\"se-code-block-inner\"><div class=\"se-code-block-bar\"><div class=\"se-code-block__copy-btn se-btn_text se-btn se-btn_tert\"><div class=\"se-btn__icon-container\"><i class=\"se-btn__icon-fill copy\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M7.91602 14.1668C7.57227 14.1668 7.27799 14.0444 7.0332 13.7996C6.78841 13.5548 6.66602 13.2606 6.66602 12.9168V4.5835C6.66602 4.23975 6.78841 3.94548 7.0332 3.70068C7.27799 3.45589 7.57227 3.3335 7.91602 3.3335H14.5827C14.9264 3.3335 15.2207 3.45589 15.4655 3.70068C15.7103 3.94548 15.8327 4.23975 15.8327 4.5835V12.9168C15.8327 13.2606 15.7103 13.5548 15.4655 13.7996C15.2207 14.0444 14.9264 14.1668 14.5827 14.1668H7.91602ZM7.91602 12.9168H14.5827V4.5835H7.91602V12.9168ZM5.41602 16.6668C5.07227 16.6668 4.77799 16.5444 4.5332 16.2996C4.28841 16.0548 4.16602 15.7606 4.16602 15.4168V5.8335H5.41602V15.4168H13.3327V16.6668H5.41602Z\" fill=\"#101423\"\/>\n<\/svg>\n<\/i><i class=\"se-btn__icon-fill check\"><svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M8.10417 14.4375L4.0625 10.4167L5.125 9.33333L8.10417 12.3125L14.875 5.5625L15.9375 6.625L8.10417 14.4375Z\" fill=\"#101423\"\/>\n<\/svg>\n<\/i><\/div>Copy<\/div><\/div><div class=\"se-code-block__content\"><pre><code>$url = 'https:\/\/api4.seranking.com\/sites';<br \/>\n$token = 'API_KEY';<br \/>\n$curl = curl_init($url);<br \/>\ncurl_setopt_array($curl, [<br \/>\nCURLOPT_HTTPHEADER =&gt; ['Authorization: Token '.$token],<br \/>\nCURLOPT_HEADER =&gt; 0,<br \/>\nCURLOPT_RETURNTRANSFER =&gt; 1,<br \/>\nCURLOPT_POST =&gt;true,<br \/>\nCURLOPT_POSTFIELDS=&gt;json_encode([<br \/>\n'url' =&gt; 'https:\/\/example.com',<br \/>\n'title' =&gt; 'my new test project'<br \/>\n])<br \/>\n]);<br \/>\n$content = curl_exec($curl);<br \/>\nif (!$content) {<br \/>\necho \"<b>\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430!<\/b>\";<br \/>\n} else {<br \/>\n$info = curl_getinfo($curl);<br \/>\n$result = json_decode($content);<br \/>\nif (201 == $info['http_code']) {<br \/>\necho $result-&gt;site_id;<br \/>\n} else {<br \/>\necho '<b>\u041e\u0448\u0438\u0431\u043a\u0430<\/b>'.$result-&gt;message;<br \/>\n}<br \/>\n}<br \/>\n<\/code><\/pre><\/div><\/div><\/div><br \/>\n<\/div><br \/>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f API \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c API-\u043a\u043b\u044e\u0447 \u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f SE Ranking. API-\u043a\u043b\u044e\u0447 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0435 token \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u043b\u0438 \u0432 HTTP-\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 Authorization. \u0415\u0441\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 API \u0432\u044b\u0437\u0432\u0430\u043d \u0431\u0435\u0437 API-\u043a\u043b\u044e\u0447\u0430 \u0438\u043b\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043d\u0435\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 API-\u043a\u043b\u044e\u0447, \u0441\u0435\u0440\u0432\u0435\u0440 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u201cno token\u201d \u0438\u043b\u0438 \u201cincorrect token\u201d. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 API-\u043a\u043b\u044e\u0447\u0430 \u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f API: \u0412\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 [&hellip;]<\/p>\n","protected":false},"author":154,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"post-templates\/single-api.php","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[4],"tags":[],"class_list":["post-3583","post","type-post","status-publish","format-standard","hentry","category-category-nocategorized"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SE Ranking API<\/title>\n<meta name=\"description\" content=\"\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 SE Ranking: \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SE Ranking API.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/seranking.com\/ru\/api-beginning-of-work.html\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SE Ranking API\" \/>\n<meta property=\"og:description\" content=\"\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 SE Ranking: \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SE Ranking API.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/seranking.com\/ru\/api-beginning-of-work.html\" \/>\n<meta property=\"og:site_name\" content=\"SE Ranking Russia\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-19T17:35:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-10T13:42:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/seranking.com\/ru\/wp-content\/uploads\/sites\/28\/2024\/09\/1200\u0445675.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"675\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SE Ranking API","description":"\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 SE Ranking: \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SE Ranking API.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/seranking.com\/ru\/api-beginning-of-work.html","og_locale":"ru_RU","og_type":"article","og_title":"\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SE Ranking API","og_description":"\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 SE Ranking: \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SE Ranking API.","og_url":"https:\/\/seranking.com\/ru\/api-beginning-of-work.html","og_site_name":"SE Ranking Russia","article_published_time":"2019-07-19T17:35:27+00:00","article_modified_time":"2024-01-10T13:42:22+00:00","og_image":[{"width":1200,"height":675,"url":"https:\/\/seranking.com\/ru\/wp-content\/uploads\/sites\/28\/2024\/09\/1200\u0445675.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/seranking.com\/ru\/api-beginning-of-work.html","url":"https:\/\/seranking.com\/ru\/api-beginning-of-work.html","name":"\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SE Ranking API","isPartOf":{"@id":"https:\/\/seranking.com\/ru\/#website"},"datePublished":"2019-07-19T17:35:27+00:00","dateModified":"2024-01-10T13:42:22+00:00","author":{"@id":""},"description":"\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 SE Ranking: \u043d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 SE Ranking API.","breadcrumb":{"@id":"https:\/\/seranking.com\/ru\/api-beginning-of-work.html#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/seranking.com\/ru\/api-beginning-of-work.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/seranking.com\/ru\/api-beginning-of-work.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f","item":"https:\/\/seranking.com\/ru\/"},{"@type":"ListItem","position":2,"name":"\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API"}]},{"@type":"WebSite","@id":"https:\/\/seranking.com\/ru\/#website","url":"https:\/\/seranking.com\/ru\/","name":"SE Ranking Russia","description":"\u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f SEO \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0441\u0430\u0439\u0442\u0430, PPC \u0438 SMM. \u0428\u0438\u0440\u043e\u043a\u0438\u0439 \u0432\u044b\u0431\u043e\u0440 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u0430. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0438 \u0412\u044b!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/seranking.com\/ru\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ru-RU"},{"@type":"Person","@id":""}]}},"_links":{"self":[{"href":"https:\/\/seranking.com\/ru\/wp-json\/wp\/v2\/posts\/3583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seranking.com\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seranking.com\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seranking.com\/ru\/wp-json\/wp\/v2\/users\/154"}],"replies":[{"embeddable":true,"href":"https:\/\/seranking.com\/ru\/wp-json\/wp\/v2\/comments?post=3583"}],"version-history":[{"count":0,"href":"https:\/\/seranking.com\/ru\/wp-json\/wp\/v2\/posts\/3583\/revisions"}],"wp:attachment":[{"href":"https:\/\/seranking.com\/ru\/wp-json\/wp\/v2\/media?parent=3583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seranking.com\/ru\/wp-json\/wp\/v2\/categories?post=3583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seranking.com\/ru\/wp-json\/wp\/v2\/tags?post=3583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}