Getting started
Instructions for uploading an RSS feed in Yandex.Webmaster.
Step 1. Get an OAuth token
- Go to thepage.
- In the Upload via API block, click the Get token button.
You have to send the OAuth token in every request in the Authorization HTTP header.
Step 2. Get the user ID
User ID is required when calling the Turbo pages API. It is passed in the user-id path parameter.
To get the ID, use the GET /v4/user operation.
curl -X GET \ 'https://api.webmaster.yandex.net/v4/user' \ -H 'Authorization: OAuth oauth_token'
Copied to clipboard
The user ID is returned in the user-id field.
Step 3. Get the RSS feed upload link
GET /v4/user/{user-id} / hosts/{host-id} / turbo/uploaddress
operation.curl -X GET \ 'https://api.webmaster.yandex.net/v4/user/12345678/hosts/https:example.com:443/turbo/uploadAddress?mode=PRODUCTION' \ -H 'Authorization: OAuth oauth_token'
Copied to clipboard
The download link is returned in the upload_address field. Use it for uploading the RSS feed.
Step 4. Upload the RSS feed
To upload the RSS feed, send a POST request to the URL you received in the previous step. The request must specify the Content-Type: application/rss+xml
header and send the RSS feed in the request body as a binary file or as a string.
curl -X POST \ https://api.webmaster.yandex.net/v4/upload/turbo/Dz3L9xOfnCecrcgv3jdTInxCY8tMl__tDWwJV9jB1VkdUmDyqx94u-11JqUte05eXYkX49q1Z9CZAsbBgKkdIQ==/ \ -H 'Authorization: OAuth oauth_token' \ -H 'Content-Type: application/rss+xml' \ -d '<?xml version = "1.0" encoding = "UTF-8"?> <rss version="2.0" xmlns:yandex="http://news.yandex.ru" xmlns:turbo="http://turbo.yandex.ru"> <channel> <item turbo="true"> <title>Page title</title> <link>https://example.com</link> <turbo:content> <![CDATA[ <header> <h1>The Healthy Breakfast restaurant</h1> <h2>Healthy and delicious</h2> <figure> <img src="https://avatars.mds.yandex.net/get-sbs-sd/403988/e6f459c3-8ada-44bf-a6c9-dbceb60f3757/orig"> </figure> <menu> <a href="https://example.com/page1.html">Menu item 1</a> <a href="https://example.com/page2.html">Menu item 2</a> </menu> </header> <p>What's a good way to start the day? With a delicious and healthy breakfast!</p> <p>Join us for breakfast. Check out photos of our dishes <a href="#">on our website</a>.</p> <h2>Menu</h2> <figure> <img src="https://avatars.mds.yandex.net/get-sbs-sd/369181/49e3683c-ef58-4067-91f9-786222aa0e65/orig"> <figcaption>Omelette with herbs</figcaption> </figure> <p>Our menu always contains fresh, delicious and healthy options.</p> <p>Find out for yourself.</p> <button formaction="tel:+7(123)456-78-90" data-background-color="#5B97B0" data-color="white" data-primary="true">Reserve a table</button> <div data-block="widget-feedback" data-stick="false"> <div data-block="chat" data-type="whatsapp" data-url="https://whatsapp.com"></div> <div data-block="chat" data-type="telegram" data-url="http://telegram.com"></div> <div data-block="chat" data-type="vkontakte" data-url="https://vk.com"></div> <div data-block="chat" data-type="facebook" data-url="https://facebook.com"></div> <div data-block="chat" data-type="viber" data-url="https://viber.com"></div> </div> <p>Our address: <a href="#">Nullam dolor massa, porta a nulla in, ultricies vehicula arcu.</a></p> <p>Photos — http://unsplash.com</p> ]]> </turbo:content> </item> </channel> </rss>'
Copied to clipboard
The operation returns the ID of the RSS feed upload task in the task_id field. It is needed to check the upload status.
Step 5. Check the upload status
To check the RSS feed upload status, pass the task ID in the task_id path parameter of the GET /v4/user/{user-id}/ hosts/{host-id}/turbo/tasks/{task-id}
operation.
- Links to view examples of Turbo page display.
- Information about errors, if they occur.
curl -X GET \ 'https://api.webmaster.yandex.net/v4/user/12345678/hosts/https:example.com:443/turbo/tasks/12345e0-678f-9e' \ -H 'Authorization: OAuth oauth_token'
Copied to clipboard