PlaybooksE-commerce
Out-of-Stock Opportunity
Amazon best sellers that are out of stock on Amazon, and the US retailers that have the same product in stock now.
- Id
out-of-stock-opportunity- Version
- 1.0.0
- Category
- E-commerce
- Status
- Live
- Saved, it runs
- daily, weekly
- Unit cap
- 300 by default, 1 to 2000
Reads Amazon's Best Sellers lists for the categories you choose and picks the products that show no offer. Each one's page is read to confirm it is unavailable or has no offer the page puts forward, then the same product is looked for at Target, Best Buy, Newegg and Walmart, keeping the retailers that have it in stock, with their price. Demand is the best-seller rank and the number of reviews; supply is gone on Amazon. For sellers who can list into an empty Buy Box.
Use when an Amazon seller wants best-selling products that are out of stock on Amazon but can be bought in stock at a US retailer.
Run it with POST /v1/formulas/out-of-stock-opportunity/runs. How runs work is in Running a playbook; what a run costs is below.
Parameters
The fields of params, the Basics first. Only the required ones must be given; every other has a default. A field that is not listed is refused. The OpenAPI document has them as the type OutOfStockOpportunityParams.
| Parameter | Type | Required or default | What it is |
|---|---|---|---|
categoriesBasics | list of strings | required | Best Sellers categories. As the list's address names them, such as toys-and-games, electronics, kitchen, or electronics/172456 for a category further down.1 or more, up to 10, each up to 120 characters. |
retailersBasics | list of strings | ["target","bestbuy"] | Retailers. Where to look for stock. Walmart often answers automated visits with a check, so its products may be missing.One of target, bestbuy, newegg, walmart.1 or more. |
pagesFilters | list of integers | [1,2] | List pages. Page 1 is ranks 1 to 50, page 2 ranks 51 to 100.One of 1, 2.1 or more. |
candidates_per_retailerFilters | integer | 2 | Results compared per retailer. at least 1, at most 5. |
max_resultsOutput | integer | 100 | Most rows. The run stops at this many product and retailer pairs, best rank first.at least 1, at most 500. |
Presets
Ready-made answers to start from: give them as params, with any of your own beside them.
Toys, electronics and video games toys-and-electronics
{
"categories": [
"toys-and-games",
"electronics",
"videogames"
]
}Home and kitchen home-and-kitchen
{
"categories": [
"kitchen",
"home-garden"
],
"retailers": [
"target",
"walmart"
]
}Columns
The columns of each row’s data, in order; rows also carry a score from 0 to 100, and come best first. A value that is not known is null.
| Column | Label | Type | Shown by default |
|---|---|---|---|
asin | ASIN | string | yes |
amazon_title | Amazon product | string | yes |
best_seller_rank | Best-seller rank | integer | yes |
category | Category | string | yes |
amazon_reviews | Reviews | integer | yes |
amazon_rating | Rating | number | no |
amazon_availability | On Amazon | string | yes |
retailer | In stock at | string | yes |
retailer_title | Retailer product | string | yes |
retailer_price | Retailer price (USD) | number | yes |
match_method | Matched by | string | yes |
match_confidence | Match confidence | number | yes |
needs_review | Needs review | boolean | yes |
amazon_url | Amazon page | url | yes |
retailer_url | Retailer page | url | yes |
score | Score | number | yes |
Example request
# Start the run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/formulas/out-of-stock-opportunity/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"params":{"categories":["toys-and-games","electronics","videogames"],"retailers":["target","bestbuy"],"pages":[1,2],"candidates_per_retailer":2,"max_results":100},"unit_cap":300}'
# Follow it until it ends, then read its rows, with the id the first call answered
curl "https://api.enrichednow.com/v1/formula-runs/$RUN_ID?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"
curl "https://api.enrichednow.com/v1/formula-runs/$RUN_ID/rows?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start the run, wait for it to end, and get its rows
params = {
"categories": ["toys-and-games", "electronics", "videogames"],
"retailers": ["target", "bestbuy"],
"pages": [1, 2],
"candidates_per_retailer": 2,
"max_results": 100,
}
result = client.run_formula("out-of-stock-opportunity", params, unit_cap=300)
print(result.run.id, result.run.status, result.run.rows_total, result.run.units_spent)
# Read its rows, best first: pages are fetched as you go
for row in result:
print(row.data)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start the run, wait for it to end, and get its rows
const params = {
categories: ["toys-and-games", "electronics", "videogames"],
retailers: ["target", "bestbuy"],
pages: [1, 2],
candidates_per_retailer: 2,
max_results: 100,
};
const { run, rows } = await client.runFormula("out-of-stock-opportunity", params, { unitCap: 300 });
console.log(run.id, run.status, run.rows_total, run.units_spent);
// Read its rows, best first: pages are fetched as you go
for await (const row of rows) console.log(row.data);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Minute)
defer cancel()
// Start the run, wait for it to end, and get its rows
params := map[string]any{"categories": []any{"toys-and-games", "electronics", "videogames"}, "retailers": []any{"target", "bestbuy"}, "pages": []any{1, 2}, "candidates_per_retailer": 2, "max_results": 100}
run, rows, err := client.RunFormula(ctx, "out-of-stock-opportunity", params, &enrichednow.RunFormulaParams{UnitCap: 300})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RowsTotal, run.UnitsSpent)
// Read its rows, best first: pages are fetched as you go
for rows.Next() {
fmt.Println(string(rows.Current().Data))
}
if err := rows.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.FormulaResult;
import com.enrichednow.FormulaRunOptions;
import com.enrichednow.models.FormulaRow;
import java.util.List;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start the run, wait for it to end, and get its rows
FormulaResult result = client.runFormula("out-of-stock-opportunity", Map.of("categories", List.of("toys-and-games", "electronics", "videogames"), "retailers", List.of("target", "bestbuy"), "pages", List.of(1, 2), "candidates_per_retailer", 2, "max_results", 100), FormulaRunOptions.builder().unitCap(300).build());
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().rowsTotal() + " " + result.run().unitsSpent());
// Read its rows, best first: pages are fetched as you go
for (FormulaRow row : result.rows()) {
System.out.println(row.data());
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow formulas run out-of-stock-opportunity --params-json '{"categories":["toys-and-games","electronics","videogames"],"retailers":["target","bestbuy"],"pages":[1,2],"candidates_per_retailer":2,"max_results":100}' --unit-cap 300Install it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
{
"name": "run_formula",
"arguments": {
"formula_id": "out-of-stock-opportunity",
"params": {
"categories": [
"toys-and-games",
"electronics",
"videogames"
],
"retailers": [
"target",
"bestbuy"
],
"pages": [
1,
2
],
"candidates_per_retailer": 2,
"max_results": 100
}
}
}It starts a full run with the answers the sample rows below were made with and the default unit cap, waits for it, and reads its rows a page at a time. The key is read from an environment variable. The MCP tab is the same run asked of an agent connected to the MCP server, which runs a preview first.
Example response
The data of the first 3 rows a real run returned with these answers on 2026-11-24: it ended ok with 7 rows, after 48 scraper calls charged 45 units. Text over 160 characters is cut here and ends with … [truncated]; the API returns every value whole.
[
{
"asin": "B0H2K3RD7C",
"amazon_title": "EA Sports Madden NFL 27 - Standard Edition PS5 |Disc I VideoGame",
"best_seller_rank": 13,
"category": "Best Sellers in Video Games",
"amazon_reviews": 300,
"amazon_rating": 4.7,
"amazon_availability": "No offer put forward",
"retailer": "Target",
"retailer_title": "EA SPORTS Madden NFL 27 - PlayStation 5",
"retailer_price": 34.99,
"match_method": "title",
"match_confidence": 0.6,
"needs_review": true,
"amazon_url": "https://www.amazon.com/dp/B0H2K3RD7C",
"retailer_url": "https://www.target.com/p/ea-sports-madden-nfl-27-playstation-5/-/A-1011566874",
"score": 30
},
{
"asin": "B0H2K3RD7C",
"amazon_title": "EA Sports Madden NFL 27 - Standard Edition PS5 |Disc I VideoGame",
"best_seller_rank": 13,
"category": "Best Sellers in Video Games",
"amazon_reviews": 300,
"amazon_rating": 4.7,
"amazon_availability": "No offer put forward",
"retailer": "Best Buy",
"retailer_title": "EA SPORTS Madden NFL 27 - PlayStation 5",
"retailer_price": 29.99,
"match_method": "title",
"match_confidence": 0.6,
"needs_review": true,
"amazon_url": "https://www.amazon.com/dp/B0H2K3RD7C",
"retailer_url": "https://www.bestbuy.com/product/ea-sports-madden-nfl-27-playstation-5/J7CYFSSQ5V/sku/6680977",
"score": 30
},
{
"asin": "B076HK9H7Z",
"amazon_title": "Sorry! Board Game for Kids Ages 6 and Up; Classic Hasbro Board Game; Each Player Gets 4 Pawns; Family Game",
"best_seller_rank": 28,
"category": "Best Sellers in Toys & Games",
"amazon_reviews": 34800,
"amazon_rating": 4.8,
"amazon_availability": "No offer put forward",
"retailer": "Target",
"retailer_title": "Classic Sorry! Board Game",
"retailer_price": 5,
"match_method": "title",
"match_confidence": 0.75,
"needs_review": true,
"amazon_url": "https://www.amazon.com/dp/B076HK9H7Z",
"retailer_url": "https://www.target.com/p/classic-sorry-board-game/-/A-10682676",
"score": 20
}
]Each row also has its id, its score, when it was first seen and its evidence: where each value came from. The run and its rows are described in Running a playbook.
Pricing
A run costs the units of the work it does, and nothing on top: each scraper call it makes is charged at that scraper's rate, when the call ends ok or partial. It never spends past its unit cap: 300 units unless you give another (at least 1, at most 2000).
With the answers above, a run is estimated at about 45 units for about 7 rows, and at most 300: 20 searches and 26 lookups across 6 sources, about 7 rows. An estimate for no history; POST /v1/formulas/out-of-stock-opportunity/estimate gives yours, free.
A preview, mode: preview, is the first 10 rows, charged at what they cost: about 45 units with the answers above. POST /v1/formulas/out-of-stock-opportunity/estimate with mode: preview gives yours, free.
How a playbook is charged has the rule for every playbook.