List active and upcoming deals for products in Levanta’s catalog. Filter by product asin and product brand.

DISCLAIMER: These deals are self-reported by sellers and are not validated by Amazon.

Method: GET (paginated)

Parameters:

Response:

{
  "deals": [
    {
      "asin": "string",
      "marketplace": "amazon.com",
      "title": "string",
      "startDate": "string",
      "endDate": "string",
      "currency": "USD",
      "fullPrice": 0,
      "discountPrice": 0,
      "discountPercentage": 0,
      "verified": true
    }
  ],
  "cursor": "string"
}

Errors:

Example:

const API_KEY = "LEVANTA_API_KEY";
const ENDPOINT = "<https://app.levanta.io/api/creator/v1/deals>";

let cursor;
const deals = [];

// Set up query parameters
const parameters = new URLSearchParams();
// Get 50 deals per response
parameters.set("limit", 50);
// Limit deals to two asins, comma-delimited
parameters.set("asins", "B0123ABCDE,BABCDE0123");
// Limit to deals active after or including October 22, 2023
parameters.set("after", "2023-10-22T00:00:00.000Z")

// Paginate through deals, stop when a value of null is returned for "cursor"
while (cursor !== null) {
    const response = await fetch(`${ENDPOINT}?${parameters.toString()}`, {
			method: "GET",
			headers: {
				Authorization: `Bearer ${API_KEY}`
			}
		});
	  const json = await response.json();
		// Store deals returned
	  deals.push(...json.deals);
    cursor = json.cursor;
    if (cursor) parameters.set("cursor", cursor);
}
console.log(deals);