Product Feed Search (Query)
This feature is allowed for Product feeds of all Advertiser verticals (Shopping/ Travel/ Finance). It can be used by both Advertisers & Publishers. Publishers can especially benefit by using this API endpoint to access Product Feed Summary as well as Product details. See the Code samples for separate methods for Feed Summary & Product Search.
Product Feed Summary Search (productFeeds)
This query provides a summary view of feed information consisting of advertiser adId, Feed Name, productCount, lastUpdated etc. GraphQL functionality can be utilized to get the exact set of fields you want from the API. For an Advertiser, this query feature allows you to access all your product feeds summary information. For a Publisher, it allows to access all the product feed summary information for one or more advertisers (Joined and non-joined). This is recommended when you want to search for specific feeds before searching for specific products.
Product Detail Search (products, shoppingProducts, travelExperienceProducts)
These queries allow you to access specific product information from an advertiser’s product feed. This is recommended when you want to search low volumes of products on a near real-time basis. They allow you to search for all common fields for all products including advertiser id, keywords, name, category, etc. GraphQL functionality can be utilized to get the exact set of fields you want from the API.
- Personal Access Token: You need to get Personal Access Token from CJ Developer Portal. If you already use a CJ personal access token for authentication, a new token need not be created.
- companyId: You need CJ generated CompanyId. This will ensure you have the permission to query on behalf of that company.
- partnerIds: As a publisher you need CJ generated CompanyId of the advertiser whose feeds you are interested in. You can specify multiple advertiser company Ids. If you do not specify then all the feeds of all the advertisers is fetched. For an advertiser, this argument is ignored.
Code Samples for Product Feed Summary
GraphQL
{
shoppingProductFeeds(companyId: 999) {
totalCount
count
resultList {
adId
feedName
advertiserId
productCount
advertiserCountry
lastUpdated
advertiserName
language
currency
sourceFeedType
}
}
}{
productFeeds(companyId: 999, partnerIds: [111, 222]) {
totalCount
count
resultList {
adId
feedName
advertiserId
productCount
advertiserCountry
lastUpdated
advertiserName
language
currency
sourceFeedType
}
}
}cURL
curl 'https://ads.api.cj.com/query' \
-X POST \
-H 'Authorization: Bearer <your-personal-access-token>' \
-d '{ shoppingProductFeeds(companyId: "999") {totalCount, count, resultList { adId, feedName, advertiserId, productCount, advertiserCountry, lastUpdated, advertiserName, language, currency, sourceFeedType} } }'curl 'https://ads.api.cj.com/query' \
-X POST \
-H 'Authorization: Bearer <your-personal-access-token>' \
-d '{ shoppingProductFeeds(companyId: "999", partnerIds: ["111", "222"]) {totalCount, count, resultList { adId, feedName, advertiserId, productCount, advertiserCountry, lastUpdated, advertiserName, language, currency, sourceFeedType} } }'Sample response
{
"data": {
"productFeeds": {
"totalCount": 2,
"count": 2,
"resultList": [
{
"sourceFeedType": "GOOGLE",
"productCount": 10,
"advertiserCountry": "US",
"lastUpdated": "2022-05-10T10:32:41.437Z",
"advertiserName": "CJDemo",
"language": "en",
"currency": "USD",
"feedName": "Product Test Feed",
"adId": "12345678",
"advertiserId": "111"
},
{
"sourceFeedType": "GOOGLE",
"productCount": 12,
"advertiserCountry": "US",
"lastUpdated": "2022-04-12T09:45:41.557Z",
"advertiserName": "CJDemo",
"language": "en",
"currency": "USD",
"feedName": "k_test_feed",
"adId": "12345679",
"advertiserId": "222"
}
]
}
}
}Code Samples for Product Detail Search
Shopping & Travel Experience (GraphQL)
{
products(companyId: "999") {
resultList {
advertiserId,
catalogId,
id,
title,
description,
price {
amount,
currency
}
linkCode(pid: "9999999") {
clickUrl
}
}
}
}Shopping & Travel Experience (cURL)
curl https://ads.api.cj.com/query \
-XPOST \
-H "Authorization: Bearer <your-personal-access-token>" \
-d '{ products(companyId: "999") {resultList { advertiserId, catalogId, id, title, description, price {amount, currency} linkCode(pid: "9999999") {clickUrl } } } }'Shopping & Travel Experience (response)
{
"data": {
"products": {
"resultList": [
{
"description": "The description of the product",
"price": {
"amount": "135.00",
"currency": "GBP"
},
"id": "123456",
"catalogId": "1111",
"title": "The Product's Title",
"linkCode": {
"clickUrl": "https://www.kqzyfj.com/click-9999999-00000000?url=https%3A%2F%2Fwww.cj.com&cjsku=123456"
},
"advertiserId": "1113122"
},
{
"description": "This is another product.",
"price": {
"amount": "63.00",
"currency": "GBP"
},
"id": "654321",
"catalogId": "1111",
"title": "The Second Product",
"linkCode": {
"clickUrl": "https://www.kqzyfj.com/click-9999999-00000000?url=https%3A%2F%2Fwww.cj.com&cjsku=654321"
},
"advertiserId": "1113122"
}
]
}
}
}Finance products (GraphQL)
query{
financeProducts(companyId: 999, adIds:[12345678]) {
resultList {
id
title
linkCode(pid: "9999999") {
clickUrl
}
...creditCard
}
}
}
fragment creditCard on CreditCard {
creditRating
marketingCopy
}Finance Products (cURL)
curl https://ads.api.cj.com/query \
-XPOST \
-H "Authorization: Bearer <your-personal-access-token>" \
-d '{"query":"query{ financeProducts(companyId: 999, adIds:[12345678]) { resultList { id title ...creditCard } } } fragment creditCard on CreditCard { creditRating marketingCopy }"}'Finance Products (response)
{
"data": {
"financeProducts": {
"resultList": [
{
"id": "A1",
"title": "CJ® Rate Advantage Master Platinum® Card",
"creditRating": "Good - Excellent",
"marketingCopy": "• Enjoy CJ's lowest rate card • No annual fee, no penalty APR • CJ membership is available to active and former military and their eligible family membersⓒ",
"linkCode": {
"clickUrl": "https://www.kqzyfj.com/click-9999999-00000000?url=https%3A%2F%2Fwww.cj.com&cjsku=A1"
}
},
{
"id": "A2",
"title": "CJ® Rate Advantage Visa Platinum® Card",
"creditRating": "Good - Excellent",
"marketingCopy": "• Enjoy CJ's lowest rate card • No annual fee, no penalty APR • CJ membership is available to active and former military and their eligible family membersⓒ",
"linkCode": {
"clickUrl": "https://www.kqzyfj.com/click-9999999-00000000?url=https%3A%2F%2Fwww.cj.com&cjsku=A2"
}
}
]
}
}
}The Product Details Search API supports pagination and has the following behavior:
- Default Record Limit: Returns up to 1,000 records.
- Maximum Limit per Query: 10,000 records.
- To retrieve more than 10,000 records, use Next Page or Subscription Query (see below).
Pagination
The Product Details Search API supports pagination and has the following behavior:
- Default Record Limit: Returns up to 1,000 records.
- Maximum Limit per Query: 10,000 records.
- To retrieve more than 10,000 records, use Next Page or Subscription Query (see below).
Pagination for ≤10,000 Records
To paginate in chunks (e.g., 50 records at a time), use the offset and limit parameters:
{
"offset": 1,
"limit": 50
}The next page:
{
"offset": 51,
"limit": 50
}Repeat this by incrementing offset by the limit until all records are retrieved.
Response Fields to Check:
totalCount: Total number of records matching the query.limit: Number of records requested.count: Number of records returned in the current page.
Pagination for >10,000 Records
Option 1: Products Search API
To fetch more than 10,000 results, the offset parameter is not used. Instead, use the page and limit parameters:
Step 1: First request (up to 10,000 records):
{
"limit": 10000
}Step 2: Next request (get the next 10,000 using page from the previous response):
{
"limit": 10000,
"page": "<nextPageTokenFromPreviousResponse>"
}offsetshould not be specified in this mode.- Repeat using the page token provided in each response to continue paginating.
Option 2: Subscription Query (Full Product Feed)
If you want to retrieve all records from an advertiser without paging through the API manually:
- Use the Subscription Query to request the full product feed directly.
Search Errors
- Authentication/Authorization Errors
- Please make sure you are including your valid Personal Access Token.
- Please make sure you have included the correct companyId argument, and that you have permission to query on behalf of that company.
- If you are a publisher and are searching for Link Code, please make sure you are using a valid PID that is owned by the company specified in the companyId field.
- If you are a publisher , you can use only one PID per request.
- Query Parsing Errors
- Feel free to use the GraphiQL App to test out your queries
- Just go to https://ads.api.cj.com in your browser.
- Don't forget your Personal Access Token in the top left corner.
Updated 11 days ago
