> ## 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.

# HarvestAPI: Get Ad

> Retrieve one LinkedIn ad by ad ID or URL. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

Retrieve one LinkedIn ad by ad ID or URL.

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

## 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(
  'harvestapi_get_ad',
  {
    "adId": "ad_123",
    "url": "https://example.com"
  },
);

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

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute harvestapi_get_ad --input '{
  "adId": "ad_123",
  "url": "https://example.com"
}' --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": {
    "status": 1,
    "error": "example"
  }
}
```

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

## Input reference

Retrieve detailed information about a specific LinkedIn Ad using its unique ID.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.adId` | `string` | No | — | The unique identifier of the LinkedIn Ad. Minimum length: 1. |
| `payload.url` | `string` | No | — | The URL of the LinkedIn Ad. Minimum length: 1. |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Retrieve detailed information about a specific LinkedIn Ad using its unique ID.",
    "properties": {
      "adId": {
        "type": "string",
        "description": "The unique identifier of the LinkedIn Ad.",
        "minLength": 1
      },
      "url": {
        "type": "string",
        "description": "The URL of the LinkedIn Ad.",
        "minLength": 1
      }
    },
    "required": [],
    "allOf": [
      {
        "anyOf": [
          {
            "required": [
              "adId"
            ]
          },
          {
            "required": [
              "url"
            ]
          }
        ]
      }
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | — |
| `result.data.element` | `object` | No | — | Provider response payload. |
| `result.data.element.id` | `string` | Yes | — | — |
| `result.data.element.variants` | `array` | Yes | — | — |
| `result.data.element.variants[].advertiser` | `object` | Yes | — | — |
| `result.data.element.variants[].advertiser.name` | `string \| null` | No | — | — |
| `result.data.element.variants[].advertiser.linkedinUrl` | `string` | No | — | — |
| `result.data.element.variants[].advertiser.imageUrl` | `string \| null` | No | — | — |
| `result.data.element.variants[].advertiser.headline` | `string \| null` | No | — | — |
| `result.data.element.variants[].content` | `object` | Yes | — | — |
| `result.data.element.variants[].content.description` | `string \| null` | No | — | — |
| `result.data.element.variants[].content.imageUrl` | `string \| null` | No | — | — |
| `result.data.element.variants[].content.videoThumbnailUrl` | `string \| null` | No | — | — |
| `result.data.element.variants[].content.videoSource` | `null` | No | — | — |
| `result.data.element.variants[].content.targetUrl` | `string \| null` | No | — | — |
| `result.data.element.variants[].content.headline` | `string \| null` | No | — | — |
| `result.data.element.variants[].content.ctaLabel` | `string \| null` | No | — | — |
| `result.data.element.variants[].content.slides` | `array` | No | — | — |
| `result.data.element.variants[].content.slides[].imageUrl` | `string \| null` | No | — | — |
| `result.data.element.variants[].content.slides[].targetUrl` | `string \| null` | No | — | — |
| `result.data.element.variants[].content.slides[].title` | `string \| null` | No | — | — |
| `result.data.element.variants[].creativeType` | `string \| null` | Yes | — | — |
| `result.data.element.about` | `object` | Yes | — | — |
| `result.data.element.about.format` | `string \| null` | No | — | — |
| `result.data.element.about.advertiserName` | `string \| null` | No | — | — |
| `result.data.element.about.advertiserUrl` | `string \| null` | No | — | — |
| `result.data.element.about.paidBy` | `string \| null` | No | — | — |
| `result.data.element.about.ranFrom` | `string \| null` | No | — | — |
| `result.data.element.about.ranTo` | `string \| null` | No | — | — |
| `result.data.element.impressions` | `object \| null` | Yes | — | — |
| `result.data.element.impressions.total` | `string \| null` | No | — | — |
| `result.data.element.impressions.byCountry` | `array` | No | — | — |
| `result.data.element.impressions.byCountry[].name` | `string \| null` | No | — | — |
| `result.data.element.impressions.byCountry[].percentage` | `string \| null` | No | — | — |
| `result.data.element.targeting` | `object \| null` | Yes | — | — |
| `result.data.element.targeting.segments` | `array` | Yes | — | — |
| `result.data.element.targeting.segments[].name` | `string` | Yes | — | — |
| `result.data.element.targeting.segments[].includes` | `array` | Yes | — | — |
| `result.data.element.targeting.segments[].excludes` | `array` | Yes | — | — |
| `result.data.element.targeting.parameters` | `array` | Yes | — | — |
| `result.data.element.targeting.parameters[].name` | `string` | Yes | — | — |
| `result.data.element.targeting.parameters[].targeted` | `boolean` | Yes | — | — |
| `result.data.element.targeting.parameters[].excluded` | `boolean` | Yes | — | — |
| `result.data.status` | `string \| integer` | No | — | — |
| `result.data.error` | `string \| null` | No | — | — |
| `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",
        "properties": {
          "element": {
            "type": "object",
            "description": "Provider response payload.",
            "properties": {
              "id": {
                "type": "string"
              },
              "variants": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "advertiser": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "linkedinUrl": {
                          "type": "string"
                        },
                        "imageUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "headline": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "content": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "imageUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "videoThumbnailUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "videoSource": {
                          "anyOf": [
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "targetUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "headline": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "ctaLabel": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "slides": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "imageUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "targetUrl": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "creativeType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "advertiser",
                    "content",
                    "creativeType"
                  ],
                  "additionalProperties": false
                }
              },
              "about": {
                "type": "object",
                "properties": {
                  "format": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "advertiserName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "advertiserUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "paidBy": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "ranFrom": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "ranTo": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "additionalProperties": false
              },
              "impressions": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "total": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "byCountry": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "percentage": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "additionalProperties": false
              },
              "targeting": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "segments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "includes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "excludes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": [
                        "name",
                        "includes",
                        "excludes"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "parameters": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "targeted": {
                          "type": "boolean"
                        },
                        "excluded": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "name",
                        "targeted",
                        "excluded"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "segments",
                  "parameters"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "id",
              "variants",
              "about",
              "impressions",
              "targeting"
            ],
            "additionalProperties": false
          },
          "status": {
            "type": [
              "string",
              "integer"
            ]
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `provider_usage` (provider usage).
* Estimated Deepline credits: `0.02` per pricing unit.

## Related documentation

* [HarvestAPI provider guide](https://deepline.com/docs/providers/harvestapi/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.