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

# Ads

> Search the public ad libraries of Meta, Google, TikTok, LinkedIn, Microsoft, and Pinterest. Get each ad's creative and copy, and find advertisers.

Search the public ad libraries of Meta, Google, TikTok, LinkedIn, Microsoft, and Pinterest. Get each ad's creative and copy, and find advertisers. See every field in the [Ads reference](/api-reference/endpoint/meta-ads-search), or try it in the [playground](https://stophy.dev/playground).

## Search ads in the Meta ad library

<CodeGroup>
  ```typescript TypeScript icon="https://mintcdn.com/sirathic/7E4w9-IC4ysabjfc/images/icons/typescript.svg?fit=max&auto=format&n=7E4w9-IC4ysabjfc&q=85&s=d8272a85e64145620f1fbbfcf7932986" theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.meta.ads.search({ query: "nike", platforms: ["instagram"], language: "en" });
  console.log(result.data.results);
  ```

  ```python Python icon="python" theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.meta.ads.search(query="nike", platforms=["instagram"], language="en")
  print(result["data"]["results"])
  ```

  ```bash cURL icon="terminal" theme={null}
  curl -X POST https://api.stophy.dev/v1/meta/ads/search \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"query":"nike","platforms":["instagram"],"language":"en"}'
  ```

  ```bash CLI icon="square-terminal" theme={null}
  stophy meta ads search nike --platforms instagram --language en
  ```
</CodeGroup>

The response:

```json theme={null}
{
  "success": true,
  "data": {
    "results": [
      {
        "adId": "abc123",
        "adUrl": "https://example.com/",
        "pageId": "abc123",
        "pageName": "example",
        "pageUrl": "https://example.com/",
        "pageAvatarUrl": "https://example.com/image.jpg",
        "pageCategories": [
          "example"
        ],
        "pageLikes": 1234,
        "isActive": false,
        "firstShownAt": "2026-09-28T12:00:00.000Z",
        "lastShownAt": "2026-09-28T12:00:00.000Z",
        "platforms": [
          "example"
        ],
        "format": "example",
        "text": "A short, readable summary of the result.",
        "linkUrl": "https://example.com/",
        "linkTitle": "example",
        "linkDescription": "example",
        "ctaText": "example",
        "imageUrls": [
          "https://example.com/image.jpg"
        ],
        "videoUrls": [
          "https://example.com/"
        ],
        "cards": [
          {
            "text": "A short, readable summary of the result.",
            "linkUrl": "https://example.com/",
            "linkTitle": "example",
            "ctaText": "example",
            "imageUrl": "https://example.com/image.jpg",
            "videoUrl": "https://example.com/"
          }
        ],
        "versions": 1,
        "categories": [
          "example"
        ],
        "paidBy": "example",
        "spendMin": 1,
        "spendMax": 1,
        "spendCurrency": "example",
        "impressionsMin": 1,
        "impressionsMax": 1,
        "reachMin": 1,
        "reachMax": 1,
        "countries": [
          "example"
        ]
      }
    ]
  },
  "creditsUsed": 1,
  "requestId": "7b4eec89-ee65-445f-afd7-89690bb5bc9d"
}
```

## Endpoints

| Endpoint | Cost |
| - | - |
| [Search ads in the Meta ad library](/api-reference/endpoint/meta-ads-search) | 1 credit |
| [Get a Meta ad's details](/api-reference/endpoint/meta-ads-ad) | 1 credit |
| [Get the ads a Facebook page runs](/api-reference/endpoint/meta-ads-page) | 1 credit |
| [Search ads in the Google ads library](/api-reference/endpoint/google-ads-search) | 1 credit |
| [Get a Google ad's details](/api-reference/endpoint/google-ads-ad) | 1 credit |
| [Find advertisers in the Google ads library](/api-reference/endpoint/google-ads-advertisers) | 1 credit |
| [Search ads in the TikTok ad library](/api-reference/endpoint/tiktok-ads-search) | 1 credit |
| [Get a TikTok ad's details and reach](/api-reference/endpoint/tiktok-ads-ad) | 1 credit |
| [Search ads in the LinkedIn ad library](/api-reference/endpoint/linkedin-ads-search) | 1 credit |
| [Get a LinkedIn ad's details](/api-reference/endpoint/linkedin-ads-ad) | 1 credit |
| [Search ads in the Microsoft ads library](/api-reference/endpoint/microsoft-ads-search) | 1 credit |
| [Get a Microsoft ad's details](/api-reference/endpoint/microsoft-ads-ad) | 1 credit |
| [Find advertisers in the Microsoft ads library](/api-reference/endpoint/microsoft-ads-advertisers) | 1 credit |
| [Search ads in the Pinterest ads library](/api-reference/endpoint/pinterest-ads-search) | 1 credit |
| [Get a Pinterest ad's details](/api-reference/endpoint/pinterest-ads-ad) | 1 credit |

## More ways to call it

### Search ads in the Google ads library

<CodeGroup>
  ```typescript TypeScript icon="https://mintcdn.com/sirathic/7E4w9-IC4ysabjfc/images/icons/typescript.svg?fit=max&auto=format&n=7E4w9-IC4ysabjfc&q=85&s=d8272a85e64145620f1fbbfcf7932986" theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.google.ads.search({ domain: "nike.com" });
  console.log(result.data.results);
  ```

  ```python Python icon="python" theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.google.ads.search(domain="nike.com")
  print(result["data"]["results"])
  ```

  ```bash cURL icon="terminal" theme={null}
  curl -X POST https://api.stophy.dev/v1/google/ads/search \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"domain":"nike.com"}'
  ```

  ```bash CLI icon="square-terminal" theme={null}
  stophy google ads search --domain nike.com
  ```
</CodeGroup>

### Find advertisers in the Google ads library

<CodeGroup>
  ```typescript TypeScript icon="https://mintcdn.com/sirathic/7E4w9-IC4ysabjfc/images/icons/typescript.svg?fit=max&auto=format&n=7E4w9-IC4ysabjfc&q=85&s=d8272a85e64145620f1fbbfcf7932986" theme={null}
  import { Stophy } from "stophy";

  const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
  const result = await stophy.google.ads.advertisers({ query: "nike" });
  console.log(result.data.results);
  ```

  ```python Python icon="python" theme={null}
  from stophy import Stophy

  stophy = Stophy()  # reads STOPHY_API_KEY
  result = stophy.google.ads.advertisers(query="nike")
  print(result["data"]["results"])
  ```

  ```bash cURL icon="terminal" theme={null}
  curl -X POST https://api.stophy.dev/v1/google/ads/advertisers \
    -H "Authorization: Bearer $STOPHY_API_KEY" \
    -H "content-type: application/json" \
    -d '{"query":"nike"}'
  ```

  ```bash CLI icon="square-terminal" theme={null}
  stophy google ads advertisers nike
  ```
</CodeGroup>

<Tip>Each ad library has its own search, ad and, for Google and Microsoft, advertisers endpoints. Each library needs a keyword, an advertiser, or both. Pinterest takes an advertiser and no keyword. Google takes a domain or an advertiser, not a keyword. See each endpoint's reference for what it accepts.</Tip>


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