---
title: "Ad"
description: "获取 LinkedIn 广告资料库中的单条广告：完整文本与媒体、出资方，以及公开时的投放日期、展示次数和定向。"
---

> Every apinoa docs page as markdown: https://apinoa.com/llms.txt (all in one file: https://apinoa.com/llms-full.txt; this API family in one file: https://apinoa.com/docs/ads/llms.txt)

```http
GET | POST /v1/linkedin-ads/ad
```

参数可以用 `GET` 的查询字符串发送，也可以用 `POST` 的 JSON 请求体发送，两者等价。

## 请求

```bash tab="cURL"
curl "https://gateway.apinoa.com/v1/linkedin-ads/ad?id=1578851684" \
  -H "x-api-key: $APINOA_API_KEY"
```

```js tab="JavaScript"
const params = new URLSearchParams({ id: "1578851684" });
const res = await fetch(`https://gateway.apinoa.com/v1/linkedin-ads/ad?${params}`, {
  headers: { "x-api-key": process.env.APINOA_API_KEY },
});
const { success, data, error } = await res.json();
```

```python tab="Python"
import os

import requests

res = requests.get(
    "https://gateway.apinoa.com/v1/linkedin-ads/ad",
    params={"id": "1578851684"},
    headers={"x-api-key": os.environ["APINOA_API_KEY"]},
)
body = res.json()
```

## 传入内容

| 传入 | 读取内容 | 说明 |
|---|---|---|
| `id` | 广告 | 广告资料库 id，或广告资料库 URL（`linkedin.com/ad-library/detail/<id>`） |

每次调用传入一个来源。所有标识符也接受页面 URL。

## 参数

| Parameter | Type | Required | Notes |
|---|---|---|---|
| `id` | string |  | The ad's Ad Library id, or its Ad Library URL (linkedin.com/ad-library/detail/<id>). |

The same parameters, and every response type, are in the OpenAPI document: https://apinoa.com/openapi.json

## 响应

在 `data` 中返回 [`Ad`](/docs/api-reference/ads/response-schema#ad)。以下为真实响应的节选：数组只保留前几项，长文本已截断。

```json
{
  "success": true,
  "data": {
    "library": "linkedin-ads",
    "id": "1578851684",
    "url": "https://www.linkedin.com/ad-library/detail/1578851684",
    "advertiser": {
      "id": "101691424",
      "name": "Quantum Security Defence",
      "url": "https://www.linkedin.com/company/101691424",
      "avatarUrl": "https://media.licdn.com/dms/image/v2/D4E0BAQHoN-S2VTf9bg/company-logo_…",
      "ext": {
        "type": "company"
      }
    },
    "paidBy": "Quantum Security and Defense Working Group lts",
    "format": "Single Image Ad",
    "text": "The G7 is urging governments and companies to start the transition to …",
    "linkUrl": "https://lnkd.in/e5J2WDUc",
    "images": [
      {
        "url": "https://media.licdn.com/dms/image/v2/D4E22AQEOAg2S6vIyxw/feedshare-ima…"
      }
    ],
    "videos": [],
    "cards": [],
    "firstShownAt": "2026-09-29",
    "lastShownAt": "2026-10-03",
    "impressions": {
      "text": "< 1k",
      "upper": 1000
    },
    "countries": [
      {
        "country": "Spain",
        "percent": 10
      },
      {
        "country": "Greece",
        "percent": 9
      },
      {
        "country": "France",
        "percent": 9
      }
    ],
    "ext": {
      "creativeType": "SPONSORED_STATUS_UPDATE",
      "links": [
        "https://lnkd.in/e5J2WDUc"
      ],
      "targeting": {
        "language": "Targeting includes English",
        "location": "Targeting includes Europe",
        "parameters": [
          {
            "name": "Audience",
            "targeted": false,
            "excluded": false
          },
          {
            "name": "Demographic",
            "targeted": false,
            "excluded": false
          },
          {
            "name": "Company",
            "targeted": false,
            "excluded": false
          }
        ]
      }
    }
  }
}
```

## 错误

| 状态 | 代码 | 含义 |
|---|---|---|
| 400 | `INVALID_PARAMS` | 参数缺失、未知或超出范围。消息中会指出是哪一个。 |
| 401 | `UNAUTHORIZED` | 缺少 `x-api-key` 请求头，或密钥已吊销或未知。 |
| 402 | `INSUFFICIENT_CREDITS` | 积分不足以支付本次调用。请在控制台选择套餐或充值。 |
| 404 | `NOT_FOUND` | LinkedIn 广告资料库中没有该 id 的广告。 |
| 429 | `MARKETPLACE_SATURATED` | 并发调用过多。请等待 `Retry-After` 秒后重试。 |
| 502 | `UPSTREAM_ERROR` | 广告资料库返回了无法使用的内容。请退避后重试。 |

所有代码见 [Errors](/docs/errors)。失败的调用不计费。

## 价格

**Price** 1 credit per call. [Plans and credits](https://apinoa.com/en/pricing).

## 说明

- 所有记录遵循统一的 [Ads API 数据结构](/docs/api-reference/ads/response-schema)。只有 LinkedIn 提供的信息在 `ext` 中。
- `firstShownAt`、`lastShownAt`、`impressions`、`countries` 和 `ext.targeting` 仅在 LinkedIn 对该广告公开时才有。LinkedIn 依据欧盟透明度规则只对部分广告公开这些信息，因此许多广告（尤其是只在欧盟以外展示的）没有。`lastShownAt` 为今天表示广告仍在投放。
- `impressions` 是 LinkedIn 所示的范围（`text`）及其给出的上下限（`lower`、`upper`）。`countries` 按名称给出各国及其展示占比（`percent`）；新广告最多可能要 48 小时后才会显示。
- `ext.targeting` 按 LinkedIn 所写（以广告的语言）给出语言和地区，并对每个定向类别（Audience、Demographic、Company、Education、Job、Member Interests and Traits）说明是用于定向还是排除。LinkedIn 不公开类别内的具体细分。
- 广告主可以是公司或会员（`advertiser.ext.type`）。公司的 `advertiser.id` 可直接传给 `ads?advertiser=`。思想领袖广告在 `ext.poster` 中给出被推广帖子的会员。
- 视频的 `url` 是最佳文件；`ext.sources` 列出每个文件及其码率。视频文件、图片和文档页面都是指向 LinkedIn 媒体服务器的链接。
