# Получение дампа

URL: https://docs.api.ostrovok.ru/docs/how-tos/process-dump/retrieve-dump/

Tags: how-tos

---


> [!WARNING]
> Размер дампа может превышать 2 ГБ.





## Запросите дамп { #request-a-dump }

[О дампе](/docs/glossary/#dump).

Вызовите один из методов:
* Retrieve hotel dump ([B2B](/docs/b2b-api/static-content/retrieve-hotel-dump/), [Affiliate](/docs/affiliate-api/static-content/retrieve-hotel-dump/)).
* Retrieve hotel custom dump ([B2B](/docs/b2b-api/static-content/retrieve-hotel-custom-dump/), [Affiliate](/docs/affiliate-api/static-content/retrieve-hotel-custom-dump/)).
* Retrieve hotel incremental dump ([B2B](/docs/b2b-api/static-content/retrieve-hotel-incremental-dump/), [Affiliate](/docs/affiliate-api/static-content/retrieve-hotel-incremental-dump/)).
* Retrieve hotel reviews’ dump ([B2B](/docs/b2b-api/static-content/retrieve-hotel-reviews-dump/), [Affiliate](/docs/affiliate-api/static-content/retrieve-hotel-reviews-dump/)).
* Retrieve regions’ dump ([B2B](/docs/b2b-api/static-content/retrieve-regions-dump/), [Affiliate](/docs/affiliate-api/static-content/retrieve-regions-dump/)).
* Retrieve hotel reviews’ incremental dump ([B2B](/docs/b2b-api/static-content/retrieve-incremental-hotel-reviews-dump/), [Affiliate](/docs/affiliate-api/static-content/retrieve-incremental-hotel-reviews-dump/)).

## Извлеките значение поля `url` из ответа { #extract-the-url-field-value-from-the-call-response }

В поле `url` лежит ссылка для скачивания дампа.




## Полный код { #full-code }


**Node.js**

```js {linenos=inline}
import fetch from 'node-fetch';

// keyId — ID API-ключа
// apiKey — access-токен API-ключа
async function retrieveDump(keyId, apiKey) {
  let dumpResponse = await fetch('https://api.ostrovok.ru/api/b2b/v3/hotel/info/dump/', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Basic ' + Buffer.from(keyId + ':' + apiKey).toString('base64')
    },
    body: JSON.stringify({
      'inventory': 'all',
      'language': 'en'
    })
  });
  const json = await dumpResponse.json();
  return json.data.url;
}

await retrieveDump(keyId, apiKey);
```

**Python**

```python {linenos=inline}
import base64
import json
import requests

# keyId — ID API-ключа
# apiKey — access-токен API-ключа
def retrieve_dump(key_id, api_key):
    encoded_credentials = base64.b64encode(f"{key_id}:{api_key}".encode("ascii")).decode("ascii")
    r = requests.post(
        url="https://api.ostrovok.ru/api/b2b/v3/hotel/info/dump/",
        json={"inventory": "all", "language": "en"},
        headers={
            "Content-Type": "application/json",
            "Authorization": f"Basic {encoded_credentials}"
        }
    )
    return r.json()["data"]["url"]

if __name__ == "__main__":
    url = retrieve_dump(key_id, api_key)
```




