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

# LeadMagic: Meta Ads Search

> Search for Meta Ads based on a company's domain or name. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

Search for Meta Ads based on a company's domain or name.

> [!NOTE]
>
> Tool ID: `leadmagic_meta_ads_search`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'leadmagic_meta_ads_search',
  {
    "company_domain": "example.com",
    "company_name": "Example Corp"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute leadmagic_meta_ads_search --input '{
  "company_domain": "example.com",
  "company_name": "Example Corp"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "ads": [
      {
        "ad_archive_id": "ad_archive_123",
        "page_id": "page_123",
        "page_name": "Example"
      }
    ]
  }
}
```

Use `deepline describe leadmagic_meta_ads_search --json` for the latest machine-readable contract.

## Input reference

Provide a company name or domain to search for ads.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.company_domain` | `string` | No | — | — |
| `payload.company_name` | `string` | No | — | — |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Provide a company name or domain to search for ads.",
    "properties": {
      "company_domain": {
        "type": "string"
      },
      "company_name": {
        "type": "string"
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.ads` | `array` | Yes | — | — |
| `result.data.ads[].ad_archive_id` | `string` | No | — | — |
| `result.data.ads[].page_id` | `string` | No | — | — |
| `result.data.ads[].page_name` | `string` | No | — | — |
| `result.data.ads[].is_active` | `boolean` | No | — | — |
| `result.data.ads[].publisher_platform` | `array` | No | — | — |
| `result.data.ads[].snapshot` | `object` | No | — | — |
| `result.data.ads[].snapshot.body` | `object` | No | — | — |
| `result.data.ads[].snapshot.body.markup` | `string` | No | — | — |
| `result.data.ads[].snapshot.title` | `string` | No | — | — |
| `result.data.ads[].snapshot.cta_text` | `string` | No | — | — |
| `result.data.ads[].snapshot.images` | `array` | No | — | — |
| `result.data.ads[].snapshot.images[].original_image_url` | `string` | No | — | Format: `uri`. |
| `result.data.ads[].snapshot.videos` | `array` | No | — | — |
| `result.data.ads[].snapshot.videos[].video_hd_url` | `string` | No | — | Format: `uri`. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "ads": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ad_archive_id": {
                  "type": "string"
                },
                "page_id": {
                  "type": "string"
                },
                "page_name": {
                  "type": "string"
                },
                "is_active": {
                  "type": "boolean"
                },
                "publisher_platform": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "snapshot": {
                  "type": "object",
                  "properties": {
                    "body": {
                      "type": "object",
                      "properties": {
                        "markup": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "title": {
                      "type": "string"
                    },
                    "cta_text": {
                      "type": "string"
                    },
                    "images": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "original_image_url": {
                            "type": "string",
                            "format": "uri"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "videos": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "video_hd_url": {
                            "type": "string",
                            "format": "uri"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            }
          }
        },
        "required": [
          "ads"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `per_result` (per result).
* Estimated Deepline credits: `0.07` per pricing unit.

## Related documentation

* [LeadMagic provider guide](https://deepline.com/docs/providers/leadmagic/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


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