Affiliate Product Search
Publisher APIThe Affiliate Product Search API returns in-stock affiliate products for a search keyword. Authentication is performed by including your PublisherKey in the request header. Fire a GET request to /api/products/search on statsapi.pubadhub.com with the required keyword parameter. The optional domain parameter filters results to a single merchant brand. Each product includes a monetized redirect_url so clicks can be attributed to your publisher account. Successful searches, including empty result sets, return HTTP 200 — always inspect the response body.
https://statsapi.pubadhub.com
/api/products/search
Tracking
Authentication
Send PublisherKey as an HTTP request header. Contact your PubAdHub Account Manager to obtain your PublisherKey. Each publisher receives a unique key — do not reuse a key across publishers. Do not send an AccessKey header for this endpoint. Accept: application/json is recommended.
PublisherKey: {PublisherKey}
Headers
PublisherKey
REQUIRED
{PublisherKey}
Your unique PubAdHub publisher key issued by your Account Manager. Do not reuse a key across publishers.
Accept
application/json
Recommended. Request a JSON response.
| Name | Value | Required | Description |
|---|---|---|---|
| PublisherKey | {PublisherKey} | REQUIRED | Your unique PubAdHub publisher key issued by your Account Manager. Do not reuse a key across publishers. |
| Accept | application/json | — | Recommended. Request a JSON response. |
Query Parameters
Query-string parameters. Required: keyword (maximum 255 characters). Optional: domain, which filters results to a single merchant brand (for example walmart.com, bestbuy.com, target.com). Map your search UI values to these names and populate keyword before the request is fired.
keyword
Location: query
Search term used to find products. Maximum 255 characters.
Example: iphone
domain
Location: query
Brand domain filter (for example walmart.com, bestbuy.com, target.com). When provided, results are limited to that merchant brand. Confirm the domain is a supported brand enabled for your account.
Example: walmart.com
| Name | Type | Required | Location | Description | Example |
|---|---|---|---|---|---|
| keyword | string | REQUIRED | query | Search term used to find products. Maximum 255 characters. | iphone |
| domain | string | OPTIONAL | query | Brand domain filter (for example walmart.com, bestbuy.com, target.com). When provided, results are limited to that merchant brand. Confirm the domain is a supported brand enabled for your account. | walmart.com |
API format
https://statsapi.pubadhub.com/api/products/search?keyword={keyword}&domain={domain}
Request example
curl --location --request GET 'https://statsapi.pubadhub.com/api/products/search?keyword=iphone&domain=walmart.com' \
--header 'PublisherKey: {PublisherKey}' \
--header 'Accept: application/json'
Response
HTTP 200. Matching in-stock products are returned in results (maximum 20). Use redirect_url for the Shop / Buy button.
{
"keyword": "iphone",
"results": [
{
"id": "123456",
"name": "Apple iPhone 15 128GB",
"image_url": "https://...",
"currency": "USD",
"regular_price": 799,
"final_price": 749,
"on_sale": true,
"availability": "InStock",
"merchant": {
"name": "Walmart"
},
"redirect_url": "https://ck.pubadhub.com/track?encyp=...&dl=..."
}
]
}
HTTP 200. When no products match, results is an empty array and message is No result found.
{
"keyword": "iphone",
"results": [],
"message": "No result found"
}
HTTP 422. Returned when required fields are missing, for example a blank keyword.
{
"error": "Validation failed",
"messages": {
"keyword": [
"The keyword field is required."
]
}
}
HTTP 401. PublisherKey is missing or not recognized.
{
"error": "Unauthorized"
}
HTTP 500. The search could not be completed.
{
"error": "Search failed.",
"message": "something went wrong"
}
Response fields
keyword
string
Echo of the search keyword.
Example: iphone
results
array
List of matching in-stock products (maximum 20).
Example: []
message
string (empty only)
Present when no products are returned: No result found.
Example: No result found
results[].id
string
Product identifier. Shown in the success sample.
Example: 123456
results[].name
string
Product title for display.
Example: Apple iPhone 15 128GB
results[].image_url
URL
Product image URL.
Example: https://...
results[].final_price
number
Current / sale price.
Example: 749.00
results[].regular_price
number
Regular / list price.
Example: 799.00
results[].currency
string
Currency code (for example USD).
Example: USD
results[].on_sale
boolean
Whether the product is on sale. Shown in the success sample.
Example: true
results[].redirect_url
URL
Monetized PubAdHub tracking link. Use this for the Shop / Buy button.
Example: https://ck.pubadhub.com/track?encyp=...&dl=...
results[].merchant.name
string
Merchant / store name.
Example: Walmart
results[].availability
string
Stock status (InStock).
Example: InStock
| Name | Type | Description | Example |
|---|---|---|---|
| keyword | string | Echo of the search keyword. | iphone |
| results | array | List of matching in-stock products (maximum 20). | [] |
| message | string (empty only) | Present when no products are returned: No result found. | No result found |
| results[].id | string | Product identifier. Shown in the success sample. | 123456 |
| results[].name | string | Product title for display. | Apple iPhone 15 128GB |
| results[].image_url | URL | Product image URL. | https://... |
| results[].final_price | number | Current / sale price. | 749.00 |
| results[].regular_price | number | Regular / list price. | 799.00 |
| results[].currency | string | Currency code (for example USD). | USD |
| results[].on_sale | boolean | Whether the product is on sale. Shown in the success sample. | true |
| results[].redirect_url | URL | Monetized PubAdHub tracking link. Use this for the Shop / Buy button. | https://ck.pubadhub.com/track?encyp=...&dl=... |
| results[].merchant.name | string | Merchant / store name. | Walmart |
| results[].availability | string | Stock status (InStock). | InStock |
Errors
Validation Failed
The keyword field is required.
{
"error": "Validation failed",
"messages": {
"keyword": [
"The keyword field is required."
]
}
}
Unauthorized
Unauthorized
{
"error": "Unauthorized"
}
Search Failed
something went wrong
{
"error": "Search failed.",
"message": "something went wrong"
}
Notes
Original PDF
This page is sourced from the official API PDF. The original file remains available.
PubAdHub Affiliate Product Search API.pdf
Related documentation
Affiliate Product Search
JSON object returned by GET /api/products/search. HTTP 200 covers both product matches and empty result sets.
Open arrow_forwardThe keyword field is required.
Affiliate Product Search validation failure (HTTP 422) when keyword is missing.
Open arrow_forwardUnauthorized
Affiliate Product Search authentication failure (HTTP 401).
Open arrow_forwardSearch failed.
Affiliate Product Search failure (HTTP 500).
Open arrow_forward