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

# 興趣

> 依關鍵字搜尋 Snapchat 興趣類別，取得可在 Snapchat 推廣中鎖定的興趣 ID。

依關鍵字搜尋 Snapchat 興趣類別。[推廣 Snap](https://www.ayrshare.com/docs/apis/ads/snapchat/boost-post.md)時，將你想要的每個興趣的 `id` 傳送到 `targeting.interests` 中。

<ul>
  <li>Snapchat 的興趣即其 Snap Lifestyle Categories，例如「Bargain Hunters」或「Beauty Mavens」。</li>
  <li>搜尋會比對名稱中包含你的搜尋詞的任何興趣。不區分大小寫。</li>
  <li>回應最多回傳 25 個相符的興趣，全部在一頁中。請使用更具體的詞來縮小清單。</li>
  <li>結果來自 Snapchat 的美國類別清單。</li>
  <li>每個結果都有 `id`、`name` 和 `path`。`path` 顯示該興趣在 Snapchat 類別樹中的位置。</li>
</ul>

## 請求頭參數

**Authorization** `string` *required*

[API Key](https://www.ayrshare.com/docs/apis/overview.md#authorization) of the Primary Profile.

Format: `Authorization: Bearer API_KEY`
**Profile-Key** `string`

[Profile Key](https://www.ayrshare.com/docs/apis/overview.md#profile-key-format) of a User Profile.

Format: `Profile-Key: PROFILE_KEY`

## 查詢參數

**search** `string` *required*

要搜尋的詞，1 到 100 個字元。請在 URL 中對其編碼，例如 `beauty%20mavens`。

```bash cURL theme={"system"}
curl \
-H "Authorization: Bearer API_KEY" \
-X GET "https://api.ayrshare.com/api/ads/snapchat/interests?search=beauty"
```

```json 200: Success theme={"system"}
{
  "status": "success",
  "kind": "interests",
  "results": [
    {
      "id": "SLC_2",
      "name": "Beauty Mavens",
      "path": "/Beauty/Beauty Mavens",
      "kind": "interests"
    }
  ],
  "meta": { "pagination": { "hasMore": false } }
}
```

```json 400: Missing search theme={"system"}
{
  "action": "request",
  "status": "error",
  "code": 101,
  "message": "Missing or incorrect parameters. Please verify with the docs. https://www.ayrshare.com/docs/apis",
  "details": "Targeting search needs a query of 1 to 100 characters."
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.