Getting started

Instructions for uploading an RSS feed in Yandex.Webmaster.

Step 1. Getting OAuth token

To work with the Yandex.Turbo pages API, you need to get an access token, for example, using Yandex.Webmaster:
  1. Go to the Turbo pages → Sources page.
  2. 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. Getting the user ID

User ID required when calling the Yandex.Turbo pages API. It is passed in the user-id path parameter.

To get the ID, use the GET /v4/user/ operation.

Example:
curl -X GET \
  'https://api.webmaster.yandex.net/v4/user' \
  -H 'Authorization: OAuth oauth_token'

The user ID is returned in the user-id field.

Step 3. Getting the RSS feed upload link.

To get a upload link, use the GET /v4/user/{user-id} / hosts/{host-id} / turbo/uploaddress operation.
Attention. Before publishing Turbo pages, we recommend to validate the markup and the correctness of display in the DEBUG mode. The mode is set with the mode query parameter when receiving the upload URL. We also recommend reviewing the RSS feed restrictions.
Example:
curl -X GET \
  'https://api.webmaster.yandex.net/v4/user/12345678/hosts/https:example.com:443/turbo/uploadAddress?mode=DEBUG' \
  -H 'Authorization: OAuth oauth_token'

The download link is returned in the upload_address field. Use it for uploading the RSS feed.

Step 4. Uploading 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.

Example:
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 entry 1</a>
              <a href="https://example.com/page2.html">Menu entry 2</a>
            </menu>
          </header>
          <p>What is a good way to start the day? Have a delicious and healthy breakfast!</p>
          <p>Come to us for breakfast. Find the photos of our dishes <a href="#">on our site</a>.</p>
          <h2>Меню</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, tasty and healthy dishes.</p>
          <p>Find it out 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 addreass: <a href="#">Nullam dolor massa, porta a nulla in, ultricies vehicula arcu.</a></p>
          <p>Potos — http://unsplash.com</p>
        ]]>
      </turbo:content>
    </item>
  </channel>
</rss>'

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. Checking 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.

The upload result contains:
  • Links where to the Turbo page examples.
  • Information about errors, if they occur.
Note. The RSS feed processing takes a long time.
Example:
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'