Auction examples
- Running auctions
- Sponsored listings
- Sponsored banners
- Sponsored brands
Asset examples
Webhook examples
Offsite Ads API
- POST[BETA] Create a new advertiser
- GET[BETA] Get advertiser details
- GET[BETA] List all audiences
- POST[BETA] Create a new audience
- POST[BETA] Upload users to an audience
- GET[BETA] List all campaigns
- POST[BETA] Create a new campaign
- GET[BETA] Get campaign details
- PATCH[BETA] Update campaign settings
- GET[BETA] Get campaign geotargeting settings
- GET[BETA] Get Job Status
- GET[BETA] Get campaign performance summary
- GET[BETA] Get daily campaign performance report
- GET[BETA] Get product-level campaign performance report
Assets API
Billing API
- GETGet Billing Contacts
- GETGet Billing Contact
- PUTUpsert Billing Contact
- GETGet Campaign Billing Contact
- PUTUpsert Campaign Billing Contact
- GETGet Marketplace Credit Limit
- POSTSet Marketplace Credit Limit
- PUTUpsert Vendor Billing Contact
- GETGet Vendor Charges
- GETGet Vendor Account Activity
- GETGet Vendor Balance
- POSTAdd Vendor Balance
- POSTBurn Vendor Balance
- GETGet Vendor Credit History
- GETGet Vendor Credit Limit
- POSTSet Vendor Credit Limit
- DELDelete Vendor Billing Contact
- GETGet Vendor Wallets
- POSTCreate Wallet
- POSTAdjust Wallet Balance
Campaign API
- GETGet Campaigns
- POSTCreate Campaign
- GETGet Campaign By Id
- DELDelete Campaign By Id
- PATCHUpdate Campaign By Id
- GETGet Campaign Bids
- POSTCreate Campaign Bids
- DELDelete Campaign Bid By Id
- PATCHUpdate Campaign Bid By Id
- GETGet Campaign Restriction
- POSTCreate Campaign Restriction
- PATCHUpdate Campaign Restriction
- POST[BETA] Get estimated clicks of a future campaign for a given vendor
- GETGet Products In Campaign
- GETGet Restriction Types
- GETGet Restriction Type
- GETGet Sponsored Products
Catalog API
Invitation API
Reporting API
- GETGet Campaign Report
- GETGet Campaign Daily Report
- GETGet Campaign Report By Product
- GETGet Product Report
- GETGet Product Daily Report
- GETGet Interactions Dump Urls
- GETGet Scored Attribution Dump Urls
- GETGet Marketplace Interactions Report
- GETGet Marketplace Report
- GETGet Marketplace Campaigns Kpis
- GETGet Marketplace Daily Report
- GETGet Marketplace Vendors Kpis
- GETGet Vendor Report
- GETGet Vendor Daily Report
Segments Service
Toppie API
- GET[BETA] Get Agency Account Balance
- GET[BETA] Get Agency Account Top-ups
- GET[BETA] Get Toppie Campaigns
- POST[BETA] Create Toppie Campaign
- GET[BETA] Get Toppie Campaign Details
- DEL[BETA] Delete Toppie Campaign
- PATCH[BETA] Update Toppie Campaign
- GET[BETA] Get Toppie Campaign Bids
- GET[BETA] List Account Products
- GET[BETA] Get Agency Account Report.
- GET[BETA] Account Activity Reports.
- GET[BETA] Get Campaigns Reporting.
- GET[BETA] Get Campaigns by IDs report.
- GET[BETA] Get Campaign Report.
- GET[BETA] Get Campaign Products Report.
Rank objects
Use the /ranking
endpoint to re-rank objects to show on a page. This endpoint can retrieve sponsored
and non-sonsored objects and rank them together, according to an appropriate context and behavior information.
curl --request POST \
--url https://api.topsort.com/toptimize/v1/rank \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"ranking": [
{
"type": "listings",
"slots": 3,
"pageSize": 3,
"category": {
"ids": [
"sneakers",
"shoes"
]
},
"products": {
"ids": [
"p_PJbnN",
"p_ojng4"
]
}
}
]
}'
{
"results": [
{
"products": [
{
"rank": 1,
"type": "organic",
"id": "p_Mfk11",
"resolvedItemId": "WyJiX01mazExIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTMyNjYtY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=="
},
{
"rank": 2,
"type": "sponsored",
"id": "p_Mfk15",
"resolvedItemId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
},
{
"rank": 3,
"type": "organic",
"id": "p_PJbnN",
"resolvedItemId": "WyJlX1BKYm5OIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
}
],
"error": false
}
]
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
Describes the context related to a Ranking request
Type of object to be ranked
listings
Specifies the maximum number of ranked objects that should be returned.
x >= 1
Specifies the maximum number of ranked objects per page that should be returned.
x >= 1
Type of page.
home
, category
, PDP
, search
, cart
, other
"category"
Identifies the page
"/category/electronics"
Detail of the page, depending on the type
"electronics"
The opaque user ID allows correlating user activity, such as Impressions, Clicks and Purchases, whether or not they are actually logged in. It must be long lived (at least a year) so that Topsort can attribute purchases. If your users are always logged in you may use a hash of your customer ID. If your users may interact with your app or site while logged out we recommend generating a random identifier (UUIDv4) on first load and store it on local storage (cookie, local storage, etc) and let it live for at least a year.
1
"71303ce0-de89-496d-8270-6434589615e8"
A category for the purpose of running an auction.
The category ID of the bids that will participate in an auction.
1
"c_yogurt"
The device for which the ads are meant for.
desktop
, mobile
An object describing geographical information associated with this auction.
The location this auction is being run for.
An array of product IDs that should participate in the auction. We recommend sending no more than 500 products per auction.
The marketplace's ID of a product which will participate in the auction. These ID must match those in the catalog integration with Topsort.
An array of marketplace defined quality scores, each corresponding to the product ID with matching array index.
If given, these values will be combined with our internal quality scores to provide a score
that better represents the relevance of the participating products.
Note that the length of this array must be the same as the length of the ids
array and
that the values must be between 0 and 1.
Response
Array of ranking objects in order from highest to lowest relevancy.
Where is the product ranked in the auction.
x >= 1
The target type of the winning bid.
organic
, sponsored
The marketplace's ID of the ranked entity.
"p_Mfk15"
An opaque Topsort ID to be used when this item is interacted with.
"WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
A boolean indicating whether this auction was resolved successfully.
false
curl --request POST \
--url https://api.topsort.com/toptimize/v1/rank \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"ranking": [
{
"type": "listings",
"slots": 3,
"pageSize": 3,
"category": {
"ids": [
"sneakers",
"shoes"
]
},
"products": {
"ids": [
"p_PJbnN",
"p_ojng4"
]
}
}
]
}'
{
"results": [
{
"products": [
{
"rank": 1,
"type": "organic",
"id": "p_Mfk11",
"resolvedItemId": "WyJiX01mazExIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTMyNjYtY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0=="
},
{
"rank": 2,
"type": "sponsored",
"id": "p_Mfk15",
"resolvedItemId": "WyJiX01mazE1IiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
},
{
"rank": 3,
"type": "organic",
"id": "p_PJbnN",
"resolvedItemId": "WyJlX1BKYm5OIiwiMTJhNTU4MjgtOGVhZC00Mjk5LTgzMjctY2ViYjAwMmEwZmE4IiwibGlzdGluZ3MiLCJkZWZhdWx0IiwiIl0="
}
],
"error": false
}
]
}