# Scrape LinkedIn Message Ads (Sponsored InMail)

**Use case:** 

Filters the LinkedIn Ad Library down to Message Ads, the sponsored InMail format, and returns the sender name and avatar, the full message body, and every call-to-action button with its destination type. Format filtering happens before any detail lookup, so ads in other formats cost neither an upstream call nor a charged result.

## Input

```json
{
  "companies": [
    "microsoft"
  ],
  "keywords": [
    "cloud migration"
  ],
  "companyIds": [],
  "countries": [],
  "maxResults": 25,
  "maxResultsPerQuery": 0,
  "adTypes": [
    "Message Ad"
  ],
  "fetchAdDetails": false,
  "enrichAdvertisers": false,
  "aiModel": "claude-haiku-4-5",
  "concurrency": 5,
  "searchUrls": [],
  "adUrls": []
}
```

## Output

```json
{
  "id": {
    "label": "Ad ID",
    "format": "string"
  },
  "adLibraryUrl": {
    "label": "Ad Library URL",
    "format": "string"
  },
  "advertiser": {
    "label": "Advertiser",
    "format": "string"
  },
  "headline": {
    "label": "Headline",
    "format": "string"
  },
  "description": {
    "label": "Description",
    "format": "string"
  },
  "cta": {
    "label": "CTA",
    "format": "string"
  },
  "destinationUrl": {
    "label": "Destination URL",
    "format": "string"
  },
  "adType": {
    "label": "Ad type",
    "format": "string"
  },
  "image": {
    "label": "Image",
    "format": "string"
  },
  "startDate": {
    "label": "Start date",
    "format": "string"
  },
  "endDate": {
    "label": "End date",
    "format": "string"
  },
  "adDuration": {
    "label": "Duration",
    "format": "string"
  },
  "targetingLocation": {
    "label": "Target: location",
    "format": "string"
  },
  "targetingLanguage": {
    "label": "Target: language",
    "format": "string"
  },
  "targetingAudience": {
    "label": "Target: audience",
    "format": "string"
  },
  "advertiserLinkedinPage": {
    "label": "Advertiser page",
    "format": "string"
  },
  "poster": {
    "label": "Poster",
    "format": "string"
  },
  "posterTitle": {
    "label": "Poster title",
    "format": "string"
  },
  "promotedBy": {
    "label": "Promoted by",
    "format": "string"
  },
  "url": {
    "label": "Ad URL",
    "format": "string"
  },
  "advertiserLogo": {
    "label": "Advertiser logo",
    "format": "string"
  },
  "creativeType": {
    "label": "Creative type",
    "format": "string"
  },
  "video": {
    "label": "Video",
    "format": "string"
  },
  "organicVideo": {
    "label": "Organic video",
    "format": "string"
  },
  "preRollVideo": {
    "label": "Pre-roll video",
    "format": "string"
  },
  "preRollAdvertiser": {
    "label": "Pre-roll advertiser",
    "format": "string"
  },
  "carouselImages": {
    "label": "Carousel images",
    "format": "array"
  },
  "sponsoredMessageButtons": {
    "label": "Message buttons",
    "format": "array"
  },
  "sponsoredMessageSender": {
    "label": "Message sender",
    "format": "string"
  },
  "sponsoredMessageSenderAvatar": {
    "label": "Message sender avatar",
    "format": "string"
  },
  "landingPage": {
    "label": "Landing page",
    "format": "string"
  },
  "totalImpressions": {
    "label": "Impressions",
    "format": "string"
  },
  "impressionsByCountry": {
    "label": "Impressions by country",
    "format": "array"
  },
  "date": {
    "label": "Event date",
    "format": "string"
  },
  "daysRunning": {
    "label": "Days running",
    "format": "integer"
  },
  "isLongestRunning": {
    "label": "Longest running",
    "format": "boolean"
  },
  "creativeAngle": {
    "label": "Creative angle",
    "format": "string"
  },
  "creativeAngleConfidence": {
    "label": "Angle confidence",
    "format": "string"
  },
  "inferredAudience": {
    "label": "Inferred audience",
    "format": "object"
  },
  "b2bIntentScore": {
    "label": "B2B intent score",
    "format": "integer"
  },
  "advertiserIndustry": {
    "label": "Advertiser industry",
    "format": "string"
  },
  "advertiserSize": {
    "label": "Advertiser size",
    "format": "string"
  },
  "advertiserEmployeeCount": {
    "label": "Advertiser employees",
    "format": "integer"
  },
  "advertiserFounded": {
    "label": "Advertiser founded",
    "format": "integer"
  },
  "advertiserType": {
    "label": "Advertiser type",
    "format": "string"
  },
  "advertiserWebsite": {
    "label": "Advertiser website",
    "format": "string"
  },
  "advertiserHeadquarters": {
    "label": "Advertiser HQ",
    "format": "string"
  },
  "_searchedByField": {
    "label": "Searched by (field)",
    "format": "string"
  },
  "_searchedByValue": {
    "label": "Searched by (value)",
    "format": "string"
  },
  "_sourceUrl": {
    "label": "Source URL",
    "format": "string"
  },
  "_scrapedAt": {
    "label": "Scraped at",
    "format": "string"
  }
}
```

## About this Actor

This example demonstrates how to use [LinkedIn Ad Library Scraper [NO COOKIES] ✅](https://apify.com/unseenuser/linkedin-ads.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/unseenuser/linkedin-ads.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/unseenuser/linkedin-ads.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
