# Access the API

The WB Custom API  is available via POST requests sent to our official API endpoint and by specifying the `engine=<WB_ENGINE>` query parameter alongside the body.

The official WB Custom API endpoint is:

* `https://ecom.webscrapingapi.com/v1`

### Making a POST request

When making a POST request, include the following components:

* **API Key**: Add your unique API key as a query parameter in the URL:\
  `https://ecom.webscrapingapi.com/v1?api_key=<YOUR_API_KEY>&engine=<WB_ENGINE>&type=product`
* **Engine Selection**: Specify the platform you wish to scrape using the `engine` parameter. Supported engines include `wayfair_async`, `bestbuy_async`, and `nordstrom_async`.

{% hint style="info" %}
You can use this as the base URL for the WB Custom API: **`https://ecom.webscrapingapi.com/v1?api_key=<YOUR_API_KEY>&engine=<WB_ENGINE>&type=product`**
{% endhint %}

* **Request Body**: The body should be a JSON object containing the necessary parameters, such as search queries, filters, or product identifiers, depending on your scraping requirements. Here’s an example request body for retrieving product details:

| Name | Type   | Description               |
| ---- | ------ | ------------------------- |
| url  | string | <https://www.example.com> |

```
[
  {
    "url": "https://www.example.com"
  },
  {
    "url": "https://www.example2.com"
  }
]

```

After submitting a POST request, you will receive a `snapshot_id` in the response. This `snapshot_id` can be used to retrieve the processed results at a later time.

### Accessing the Snapshot API

The Snapshot API allows you to retrieve results from a previously submitted POST request using the `snapshot_id`. This feature is useful for asynchronous processing and ensures that you can access data when it is ready.

* **Snapshot API Endpoint**:\
  `https://ecom.webscrapingapi.com/v1`
* **Required Parameters**:
  * `api_key`: Your unique API key.
  * `snapshot_id`: The ID returned from the POST request.
* **Example GET Request**:

```bash
GET https://ecom.webscrapingapi.com/v1?api_key=<YOUR_API_KEY>&snapshot_id=<SNAPSHOT_ID>
```

The response will include the results associated with the `snapshot_id` in JSON format.

### The API key

Our WB Custom API requires an API key for authentication. The key is embedded in the URL as a query parameter called `api_key` and has to be included on each GET request, for the request to pass. Failing to pass the <mark style="color:yellow;">**required**</mark> `api_key` parameter or passing an incorrect key will result in an `Unauthorized` HTTP status.

To obtain an API key for the WB Custom API, you have to:&#x20;

1. [Register](/readme/registration.md) a new account on our official platform
2. Get access to this service upon request

{% hint style="success" %}
Subscription to the WB Custom API gives you access to all supported engines: Wayfair, Best Buy and Nordstrom.
{% endhint %}

In the following documentation, we will refer to the API key by using this syntax:**`<YOUR_API_KEY>`**

{% hint style="warning" %}
Please make sure to store your private API key in a secure location and never make it publicly available. Using the API key directly impacts you subscription plan. &#x20;
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.webscrapingapi.com/wb-custom-search-api/getting-started/access-the-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
