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

# Get Ad Details

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

<CodeGroup>
  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({
    url: 'https://www.linkedin.com/ad-library/detail/1104386363',
    // adId: '1104386363', // Alternatively, by Ad ID
  });

  fetch(`https://api.harvestapi.io/linkedin/ad?${params.toString()}`, {
    headers: { 'X-API-Key': '<api-key>' },
  })
    .then((response) => response.json())
    .then((data) => console.log(data));
  ```

  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.harvestapi.io/linkedin/ad?adId=1104386363 \
    --header 'X-API-Key: <api-key>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.harvestapi.io/linkedin/ad?adId=1104386363"

  headers = {"X-API-Key": "<api-key>"}

  response = requests.request("GET", url, headers=headers)

  print(response.text)
  ```
</CodeGroup>


## OpenAPI

````yaml GET /linkedin/ad
openapi: 3.0.1
info:
  title: HarvestAPI LinkedIn API reference
  description: HarvestAPI LinkedIn API reference
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.harvestapi.io
security:
  - ApiKeyAuthHeader: []
paths:
  /linkedin/ad:
    get:
      summary: Get LinkedIn Ad by ID
      description: >-
        Retrieve detailed information about a specific LinkedIn Ad using its
        unique ID.
      parameters:
        - name: adId
          in: query
          description: The unique identifier of the LinkedIn Ad.
          schema:
            type: string
        - name: url
          in: query
          description: The URL of the LinkedIn Ad.
          schema:
            type: string
      responses:
        '200':
          description: Detailed information about the specified LinkedIn Ad.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LinkedInAd'
        '400':
          description: Invalid request parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Ad not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    LinkedInAd:
      type: object
      required:
        - id
        - variants
        - about
        - impressions
        - targeting
      properties:
        id:
          type: string
        variants:
          type: array
          items:
            type: object
            required:
              - advertiser
              - content
              - creativeType
            properties:
              advertiser:
                type: object
                properties:
                  name:
                    type: string
                    nullable: true
                  linkedinUrl:
                    type: string
                  imageUrl:
                    type: string
                    nullable: true
                  headline:
                    type: string
                    nullable: true
              content:
                type: object
                properties:
                  description:
                    type: string
                    nullable: true
                  imageUrl:
                    type: string
                    nullable: true
                  videoThumbnailUrl:
                    type: string
                    nullable: true
                  videoSource:
                    nullable: true
                  targetUrl:
                    type: string
                    nullable: true
                  headline:
                    type: string
                    nullable: true
                  ctaLabel:
                    type: string
                    nullable: true
                  slides:
                    type: array
                    items:
                      type: object
                      properties:
                        imageUrl:
                          type: string
                          nullable: true
                        targetUrl:
                          type: string
                          nullable: true
                        title:
                          type: string
                          nullable: true
              creativeType:
                type: string
                nullable: true
        about:
          type: object
          properties:
            format:
              type: string
              nullable: true
            advertiserName:
              type: string
              nullable: true
            advertiserUrl:
              type: string
              nullable: true
            paidBy:
              type: string
              nullable: true
            ranFrom:
              type: string
              nullable: true
            ranTo:
              type: string
              nullable: true
        impressions:
          type: object
          properties:
            total:
              type: string
              nullable: true
            byCountry:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                    nullable: true
                  percentage:
                    type: string
                    nullable: true
        targeting:
          type: object
          required:
            - segments
            - parameters
          properties:
            segments:
              type: array
              items:
                type: object
                required:
                  - name
                  - includes
                  - excludes
                properties:
                  name:
                    type: string
                  includes:
                    type: array
                    items:
                      type: string
                  excludes:
                    type: array
                    items:
                      type: string
            parameters:
              type: array
              items:
                type: object
                required:
                  - name
                  - targeted
                  - excluded
                properties:
                  name:
                    type: string
                  targeted:
                    type: boolean
                  excluded:
                    type: boolean
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
  securitySchemes:
    ApiKeyAuthHeader:
      type: apiKey
      in: header
      name: X-API-Key

````