B2B Search Ads
Search for B2B ads by company domain or name.
POST
/
v1
/
ads
/
b2b-ads-search
B2B Search Ads
curl --request POST \
--url https://api.leadmagic.io/v1/ads/b2b-ads-search \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"company_domain": "leadmagic.io",
"company_name": "leadmagic"
}
'import requests
url = "https://api.leadmagic.io/v1/ads/b2b-ads-search"
payload = {
"company_domain": "leadmagic.io",
"company_name": "leadmagic"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({company_domain: 'leadmagic.io', company_name: 'leadmagic'})
};
fetch('https://api.leadmagic.io/v1/ads/b2b-ads-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leadmagic.io/v1/ads/b2b-ads-search"
payload := strings.NewReader("{\n \"company_domain\": \"leadmagic.io\",\n \"company_name\": \"leadmagic\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leadmagic.io/v1/ads/b2b-ads-search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'company_domain' => 'leadmagic.io',
'company_name' => 'leadmagic'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"message": "B2B Ads retrieved successfully",
"credits_consumed": 2,
"ads_count": 2,
"ads": [
{
"content": "Start your day knowing what deals you need to focus on instead of opening up a dozen tabs in your CRM.",
"link": 633872143
},
{
"content": "Start your day knowing what deals you need to focus on instead of opening up a dozen tabs in your CRM.",
"link": 633865353
}
]
}{
"success": false,
"errors": [
{
"type": "https://api.leadmagic.io/errors/validation_error",
"title": "Request validation failed. Check your input parameters.",
"status": 400,
"code": "validation_error",
"param": [
"email"
],
"detail": "Email format is invalid. Expected format: user@domain.com",
"action": "Provide a valid email address in the 'email' field.",
"docs": "https://leadmagic.io/docs/api-reference/errors"
}
],
"meta": {
"request_id": "ea6e3248-f4d2-437d-bca3-20881b529129",
"timestamp": "2024-02-01T12:00:00.000Z"
}
}{
"success": false,
"errors": [
{
"type": "https://api.leadmagic.io/errors/missing_authentication",
"title": "Authentication required. Provide a valid API key in the X-API-Key header (case-insensitive).",
"status": 401,
"code": "missing_authentication",
"docs": "https://leadmagic.io/docs/api-reference/authentication"
}
],
"meta": {
"request_id": "ea6e3248-f4d2-437d-bca3-20881b529129",
"timestamp": "2024-02-01T12:00:00.000Z"
}
}{
"success": false,
"errors": [
{
"type": "https://api.leadmagic.io/errors/insufficient_credits",
"title": "Insufficient credits: need 5, have 2.50. Add credits to continue.",
"status": 402,
"code": "insufficient_credits",
"detail": "This request requires 5 credit(s) but your account only has 2.50 credits remaining.",
"action": "Add credits to your account at https://app.leadmagic.io/billing or contact support@leadmagic.io for enterprise plans.",
"docs": "https://leadmagic.io/docs/api-reference/credits",
"context": {
"credits_required": 5,
"credits_available": 2.5,
"credits_needed": 2.5
}
}
],
"meta": {
"request_id": "ea6e3248-f4d2-437d-bca3-20881b529129",
"timestamp": "2024-02-01T12:00:00.000Z"
}
}{
"success": false,
"errors": [
{
"type": "https://api.leadmagic.io/errors/rate_limit_exceeded",
"title": "Rate limit exceeded: 300 requests per 1 minute. Wait and try again.",
"status": 429,
"code": "rate_limit_exceeded",
"detail": "You have exceeded the maximum allowed request rate. Please wait before making additional requests.",
"action": "Wait 42 seconds before retrying. Consider implementing exponential backoff.",
"docs": "https://leadmagic.io/docs/api-reference/rate-limits",
"context": {
"limit": 300,
"window": "1 minute",
"remaining": 0,
"reset_at": 1706745642,
"retry_after_seconds": 42
}
}
],
"meta": {
"request_id": "ea6e3248-f4d2-437d-bca3-20881b529129",
"timestamp": "2024-02-01T12:00:00.000Z"
}
}{
"success": false,
"errors": [
{
"type": "https://api.leadmagic.io/errors/INTERNAL_ERROR",
"title": "Something went wrong on our end. Our team has been notified and is investigating.",
"status": 500,
"code": "INTERNAL_ERROR",
"detail": "This is a temporary server error. The issue has been automatically reported to our team.",
"action": "Wait 30 seconds and retry your request. If the problem persists, contact support@leadmagic.io",
"docs": "https://leadmagic.io/docs/api-reference/errors"
}
],
"meta": {
"request_id": "ea6e3248-f4d2-437d-bca3-20881b529129",
"timestamp": "2024-02-01T12:00:00.000Z"
}
}B2B Ads
Search for B2B professional network ads run by a company. Perfect for understanding B2B advertising strategies and competitive positioning.Endpoint Details
- Pricing
- Rate Limits
| Metric | Value |
|---|---|
| Cost | 0.2 credits per search |
| Calculation | 5 searches = 1 credit |
| No Results | FREE if no ads found |
Very cost-effective for B2B ad intelligence at just 0.2 credits per search.
Per-Endpoint Limit
| Metric | Value |
|---|---|
| Requests/Minute | 300 |
| Burst Capacity | ~5 requests/second |
Rate limits are subject to change. Custom rate limits are available on enterprise plans — contact us.
Quick Example
curl -X POST 'https://api.leadmagic.io/v1/ads/b2b-ads-search' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"company_domain": "leadmagic.io"}'
const response = await fetch('https://api.leadmagic.io/v1/ads/b2b-ads-search', {
method: 'POST',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ company_domain: 'leadmagic.io' })
});
const data = await response.json();
console.log(`Found ${data.ads?.length || 0} B2B ads`);
import requests
response = requests.post(
'https://api.leadmagic.io/v1/ads/b2b-ads-search',
headers={'X-API-Key': 'YOUR_API_KEY'},
json={'company_domain': 'leadmagic.io'}
)
data = response.json()
print(f"Found {len(data.get('ads', []))} B2B ads")
Request Parameters
string
Company website domain (preferred).
string
Company name.
You must provide either
company_domain or company_name (or both).Response
string
required
Company searched
array
required
Array of ad creatives
number
required
Credits used (0.2 if found, 0 if not)
string
required
Human-readable status message
Ad Object
| Field | Type | Description |
|---|---|---|
content | string | Ad copy/headline |
link | string | Ad Library ID (use with B2B Ad Details) |
image_url | string | Ad image URL |
Example Response
{
"company_name": "Example CRM",
"ads": [
{
"content": "Transform your business with the #1 CRM",
"link": "633872143",
"image_url": "https://..."
}
],
"credits_consumed": 0.2,
"message": "Ads found."
}
Success Messages
| Message | Meaning | Cost |
|---|---|---|
Ads found. | B2B Ads data returned | 0.2 credits |
No ads found for this company. | No B2B Ads found | FREE |
Best Practices
Get full ad details
Get full ad details
Use the
link field with B2B Ad Details for complete creative data.Analyze B2B messaging
Analyze B2B messaging
B2B ads reveal competitor positioning and value propositions.
See how target accounts advertise
See how target accounts advertise
Understand how your prospects market to their customers.
Use Cases
Competitive Intelligence
Monitor competitor B2B advertising strategies.
Messaging Research
Study B2B value propositions and positioning.
Account Research
See how target accounts advertise to their customers.
Market Analysis
Analyze B2B advertising trends in your industry.
Authorizations
Your LeadMagic API key. Header name is case-insensitive (X-API-Key, X-API-KEY, x-api-key all work).
Body
application/json
Was this page helpful?
⌘I
B2B Search Ads
curl --request POST \
--url https://api.leadmagic.io/v1/ads/b2b-ads-search \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"company_domain": "leadmagic.io",
"company_name": "leadmagic"
}
'import requests
url = "https://api.leadmagic.io/v1/ads/b2b-ads-search"
payload = {
"company_domain": "leadmagic.io",
"company_name": "leadmagic"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({company_domain: 'leadmagic.io', company_name: 'leadmagic'})
};
fetch('https://api.leadmagic.io/v1/ads/b2b-ads-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.leadmagic.io/v1/ads/b2b-ads-search"
payload := strings.NewReader("{\n \"company_domain\": \"leadmagic.io\",\n \"company_name\": \"leadmagic\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.leadmagic.io/v1/ads/b2b-ads-search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'company_domain' => 'leadmagic.io',
'company_name' => 'leadmagic'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"message": "B2B Ads retrieved successfully",
"credits_consumed": 2,
"ads_count": 2,
"ads": [
{
"content": "Start your day knowing what deals you need to focus on instead of opening up a dozen tabs in your CRM.",
"link": 633872143
},
{
"content": "Start your day knowing what deals you need to focus on instead of opening up a dozen tabs in your CRM.",
"link": 633865353
}
]
}{
"success": false,
"errors": [
{
"type": "https://api.leadmagic.io/errors/validation_error",
"title": "Request validation failed. Check your input parameters.",
"status": 400,
"code": "validation_error",
"param": [
"email"
],
"detail": "Email format is invalid. Expected format: user@domain.com",
"action": "Provide a valid email address in the 'email' field.",
"docs": "https://leadmagic.io/docs/api-reference/errors"
}
],
"meta": {
"request_id": "ea6e3248-f4d2-437d-bca3-20881b529129",
"timestamp": "2024-02-01T12:00:00.000Z"
}
}{
"success": false,
"errors": [
{
"type": "https://api.leadmagic.io/errors/missing_authentication",
"title": "Authentication required. Provide a valid API key in the X-API-Key header (case-insensitive).",
"status": 401,
"code": "missing_authentication",
"docs": "https://leadmagic.io/docs/api-reference/authentication"
}
],
"meta": {
"request_id": "ea6e3248-f4d2-437d-bca3-20881b529129",
"timestamp": "2024-02-01T12:00:00.000Z"
}
}{
"success": false,
"errors": [
{
"type": "https://api.leadmagic.io/errors/insufficient_credits",
"title": "Insufficient credits: need 5, have 2.50. Add credits to continue.",
"status": 402,
"code": "insufficient_credits",
"detail": "This request requires 5 credit(s) but your account only has 2.50 credits remaining.",
"action": "Add credits to your account at https://app.leadmagic.io/billing or contact support@leadmagic.io for enterprise plans.",
"docs": "https://leadmagic.io/docs/api-reference/credits",
"context": {
"credits_required": 5,
"credits_available": 2.5,
"credits_needed": 2.5
}
}
],
"meta": {
"request_id": "ea6e3248-f4d2-437d-bca3-20881b529129",
"timestamp": "2024-02-01T12:00:00.000Z"
}
}{
"success": false,
"errors": [
{
"type": "https://api.leadmagic.io/errors/rate_limit_exceeded",
"title": "Rate limit exceeded: 300 requests per 1 minute. Wait and try again.",
"status": 429,
"code": "rate_limit_exceeded",
"detail": "You have exceeded the maximum allowed request rate. Please wait before making additional requests.",
"action": "Wait 42 seconds before retrying. Consider implementing exponential backoff.",
"docs": "https://leadmagic.io/docs/api-reference/rate-limits",
"context": {
"limit": 300,
"window": "1 minute",
"remaining": 0,
"reset_at": 1706745642,
"retry_after_seconds": 42
}
}
],
"meta": {
"request_id": "ea6e3248-f4d2-437d-bca3-20881b529129",
"timestamp": "2024-02-01T12:00:00.000Z"
}
}{
"success": false,
"errors": [
{
"type": "https://api.leadmagic.io/errors/INTERNAL_ERROR",
"title": "Something went wrong on our end. Our team has been notified and is investigating.",
"status": 500,
"code": "INTERNAL_ERROR",
"detail": "This is a temporary server error. The issue has been automatically reported to our team.",
"action": "Wait 30 seconds and retry your request. If the problem persists, contact support@leadmagic.io",
"docs": "https://leadmagic.io/docs/api-reference/errors"
}
],
"meta": {
"request_id": "ea6e3248-f4d2-437d-bca3-20881b529129",
"timestamp": "2024-02-01T12:00:00.000Z"
}
}