> ## Documentation Index
> Fetch the complete documentation index at: https://help.decodo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TikTok Shop Search

> Web Scraping API TikTok Shop Search Template

<Danger>
  Core and Advanced plans are no longer available for purchase. Please consider migrating to the all-in-one Web Scraper API; check out the guide [here](https://help.decodo.com/docs/web-scraping-api-migration-guide).
</Danger>

The `tiktok_shop_search` template is built to obtain search result pages from TikTok Shop.

<Note>
  ### Useful Links

  * This target is available with **Web API Advanced plans**.
  * [**Real-time**](https://help.decodo.com/docs/web-scraping-api-real-time-requests) and [**Asynchronous**](https://help.decodo.com/docs/web-scraping-api-asynchronous-requests) integration methods are available for this template.
  * [**Batch**](https://help.decodo.com/docs/web-scraping-api-asynchronous-requests#queue-multiple-tasks) requests are also supported.
</Note>

## Input Parameters

Request parameters available for the TikTok Shop Search template:

| Parameter     | Type    | Required | Description                                                                                                                                                                                                                                                                  |
| ------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `target`      | string  | ✅        | Target type must be set to `tiktok_shop_search`.                                                                                                                                                                                                                             |
| `query`       | string  | ✅        | Search query.                                                                                                                                                                                                                                                                |
| `country`     | string  |          | Set this parameter to `gb` when you want to retrieve results specific to the United Kingdom.                                                                                                                                                                                 |
| `headless`    | string  |          | `html` value enables JavaScript rendering. [**Read more.**](https://help.decodo.com/docs/web-scraping-api-javascript-rendering)<br />`png` value enables screenshot response. [**Read more.**](https://help.decodo.com/docs/web-scraping-api-screenshot-response-deprecated) |
| `device_type` | string  |          | Specify device type and browser. [**Read more.**](https://help.decodo.com/docs/web-scraping-api-device-types-deprecated)                                                                                                                                                     |
| `xhr`         | boolean |          | Set to `true` to retrieve a list of XHR and fetch requests. [**Read more.**](https://help.decodo.com/docs/web-scraping-api-fetch-and-xhr-deprecated)<br />Default value is `false`.                                                                                          |
| `markdown`    | boolean |          | Set to `true` to receive a Markdown response. [**Read more.**](https://help.decodo.com/docs/web-scraping-api-markdown-response-deprecated)<br />Default value is `false`.                                                                                                    |

### Request Examples

<CodeGroup>
  ```shellscript cURL theme={null}
  # update 'TOKEN VALUE' with your authorization token
  curl --request 'POST' \
          --url 'https://scraper-api.decodo.com/v2/scrape' \
          --header 'Accept: application/json' \
          --header 'Authorization: Basic TOKEN VALUE' \
          --header 'Content-Type: application/json' \
          --data '
      {
        "target": "tiktok_shop_search", 
      	"query": "hoodie",
      	"headless": "html"
      }
  '
  ```

  ```javascript Node theme={null}
  const scrape = async() => {
    const response = await fetch("https://scraper-api.decodo.com/v2/scrape", {
      method: "POST",
      body: JSON.stringify({
        "target": "tiktok_shop_search",
        "query": "hoodie",
        "headless": "html"
      }),
      headers: {
        "Content-Type": "application/json",
        "Authorization": "Basic TOKEN VALUE" // update with your authorization token
      },
    }).catch(error => console.log(error));

    console.log(await response.json())
  }

  scrape()
  ```

  ```python Python theme={null}
  import requests
    
  url = "https://scraper-api.decodo.com/v2/scrape"
    
  payload = {
        "target": "tiktok_shop_search",
        "query": "hoodie",
        "headless": "html"
  }
    
  headers = {
      "accept": "application/json",
      "content-type": "application/json",
      "authorization": "Basic TOKEN VALUE" # update with your authorization token
  }
    
  response = requests.post(url, json=payload, headers=headers)
    
  print(response.text)
  ```
</CodeGroup>

## Output

#### Response Example

<CodeGroup>
  ```json JSON expandable theme={null}
  import requests
    
  url = "https://scraper-api.decodo.com/v2/scrape"
    
  payload = {
        "target": "tiktok_shop_search",
        "query": "hoodie",
        "headless": "html"
  }
    
  headers = {
      "accept": "application/json",
      "content-type": "application/json",
      "authorization": "Basic TOKEN VALUE" # update with your authorization token
  }
    
  response = requests.post(url, json=payload, headers=headers)
    
  print(response.text)
  ```
</CodeGroup>

***

<Columns cols={2}>
  <Card title="Support" href="https://direct.lc.chat/12092754" cta="Let's chat!">
    Need help or just want to say hello? Our support is available 24/7. \
    You can also reach us anytime via email at [support@decodo.com](mailto:support@decodo.com).
  </Card>

  <Card title="Feedback" href="mailto:feedback@decodo.com" cta="Share feedback">
    Can't find what you're looking for? Request an article! \
    Have feedback? Share your thoughts on how we can improve.
  </Card>
</Columns>
