To get an Amazon Buy Box lost alert pushed to your phone today, poll /amazon-product-offers for each of your ASINs, compare buyBox.sellerId with your own seller ID, and send a notification through Pushover: POST a token, user and message to api.pushover.net/1/messages.json, no webhook server or app approval needed. The script below sends one push per run, tells a lost Buy Box apart from a suppressed one, and costs one SellerMagnet credit per ASIN per check plus one Pushover message, well inside the free 10,000-messages-a-month allowance.
Key Takeaways
- Pushover auth is just two keys in the POST body (
token, the app's API token;user, the recipient's user or group key) - no OAuth, no webhook URL, no app server to receive calls. - buyBox is the featured offer: its sellerId is the seller who holds the Buy Box, the literal "Amazon" when Amazon does.
- An empty buyBox means two different things: buyBoxSuppressed true (offers exist, Amazon features none) or no offers at all.
- Alert only when two checks in a row agree: an offer page can come back without parsable offers, and one reading should not page you.
- Priority 1 bypasses Pushover's quiet hours and always plays sound and vibration; the default priority 0 does not - during quiet hours Pushover quietly delivers it as though it were priority -1 instead, which would delay a Buy Box alert without saying so.
- A successful send answers 2xx with
{"status": 1}; any 4xx, or a 200 withstatusnot 1, is a permanent input problem (bad token, dead user, over quota) and must never be retried unchanged - only a 500 or no reply is worth one retry, and only after waiting 5 seconds. - Each check costs 1 SellerMagnet credit per ASIN; 502/503 retries are billed per attempt, a 500 is refunded, and a free 401/403 stops the run with one STOP push.
How is Pushover different from a Slack- or Teams-style webhook?
There is no webhook URL to create. Pushover (pushover.net/api, checked 2026-11-23) works the other way round: you register a free application once to get a 30-character token, each recipient copies their own 30-character user key from their Pushover dashboard, and every send is one POST with token, user and message in the body - no signing, no bearer header, no incoming-webhook app to install in a chat tool. That also means Pushover pages a person's phone/desktop app directly rather than posting into a shared channel, which suits a Buy Box alert aimed at one seller rather than a team channel.
| Response | Reading | Pushover message |
|---|---|---|
| buyBox.sellerId is your sellerId | mine | BACK, after a confirmed loss |
| buyBox.sellerId is any other seller or "Amazon" | lost | LOST, with holder, price and your offer |
| buyBox is {} and buyBoxSuppressed is true | suppressed | NONE |
| buyBox is {} and offers is [] | no-offers | EMPTY |
How do I build the Amazon Buy Box lost alert for Pushover?
read_buy_box() turns one offers response into a reading, check() keeps a streak per ASIN in buybox_state.json and queues a line once a new reading has been seen CONFIRM times in a row, and post_to_pushover() sends every queued line as one push. get_with_retry comes from retry.py and ApiError and new_session from sellermagnet.py, both from the Python quickstart. Malformed ASINs are skipped before any call, because the offers endpoint bills a typo like any other request. MY_SELLER_ID has no default on purpose: without it every ASIN would read as lost, so the script refuses to start. A new ASIN seeds its state to whatever it first reads, so a listing that starts out suppressed never fires a false alert just for staying that way. Lines are capped and summarized before the message reaches Pushover's documented 1024-character limit, instead of letting a long batch get silently rejected or cut off mid-word.
buybox_pushover_alert.py - offers check, 2-check confirmation, one push per run
import json
import os
import re
import time
import requests
from retry import get_with_retry
from sellermagnet import ApiError, new_session
MARKETPLACE_ID = "ATVPDKIKX0DER" # amazon.com
MY_SELLER_ID = os.environ["MY_SELLER_ID"] # your sellerId as it appears in offers[]; no default on purpose
ASINS = ["B0CL61F39H", "B0EXAMPLE2", "B0EXAMPLE3"]
CONFIRM = 2 # same reading on 2 checks in a row before Pushover hears about it
STATE_FILE = "buybox_state.json"
ASIN_RE = re.compile(r"^[A-Z0-9]{10}$") # offers calls are billed even for a typo, so filter first
MAX_MESSAGE_CHARS = 1024 # pushover.net/api hard limit on the message body
MAX_LINES = 8 # keep well under the 1024-char body even with long lines
def read_buy_box(session, asin: str) -> tuple[str, str]:
"""('mine' | 'lost' | 'suppressed' | 'no-offers', detail for the message)."""
data = get_with_retry(session, "amazon-product-offers", asin=asin, marketplaceId=MARKETPLACE_ID)
box = data.get("buyBox") or {}
if not box:
# {} has two causes: offers exist but Amazon features none, or no offer at all (or none parsable)
return ("suppressed", "") if data.get("buyBoxSuppressed") else ("no-offers", "")
holder = box.get("sellerId") or "unknown"
if holder == MY_SELLER_ID:
return "mine", ""
currency = (data.get("currency") or {}).get("code", "")
detail = f"{box.get('sellerName', '?')} ({holder}, {box.get('fulfillmentType', '?')})"
if isinstance(box.get("totalPrice"), (int, float)): # price + shipping as floats, not rounded by the API
detail += f" at {box['totalPrice']:.2f} {currency}"
mine = [o["totalPrice"] for o in data.get("offers") or []
if o.get("sellerId") == MY_SELLER_ID and isinstance(o.get("totalPrice"), (int, float))]
detail += f", your offer {min(mine):.2f}" if mine else ", your offer: not on the first offer page"
return "lost", detail # any other holder is the same reading: a rotation still confirms
def line_for(asin: str, key: str, detail: str) -> str:
text = {"mine": "BACK, you hold the Buy Box again",
"suppressed": "NONE, offers exist but Amazon features none",
"no-offers": "EMPTY, no offers on the listing"}.get(key, f"LOST, held by {detail}")
return f"{asin}: {text}"
def build_message(lines: list[str]) -> str:
# pushover.net/api: messages are limited to 1024 UTF-8 characters. Summarize instead of truncating mid-line.
if len(lines) > MAX_LINES:
lines = lines[:MAX_LINES] + [f"+{len(lines) - MAX_LINES} more, see the dashboard"]
body = "\n".join(lines)
while len(body) > MAX_MESSAGE_CHARS and lines:
lines = lines[:-1] + [f"+1 more, see the dashboard"]
body = "\n".join(lines)
return body
def post_to_pushover(token: str, user: str, lines: list[str]) -> bool:
"""One message per run. A successful send answers 2xx with {"status": 1, "request": "..."}.
A 4xx, or a 200 whose status is not 1, means the INPUT was bad - never retry the same request
(pushover.net/api, checked 2026-11-23). A 500 or no reply is Pushover's own problem and may be
retried, but no sooner than 5 seconds after the last attempt."""
if not lines:
return True
payload = {
"token": token, "user": user, "priority": 1, # bypasses quiet hours, still a single send
"title": "Amazon Buy Box change, confirmed on 2 checks",
"message": build_message(lines),
}
for attempt in range(2): # at most one retry, only for the temporary class
try:
resp = requests.post("https://api.pushover.net/1/messages.json", data=payload, timeout=10)
except requests.RequestException as err:
print(f"pushover unreachable: {type(err).__name__}")
if attempt == 0:
time.sleep(5) # docs: no sooner than 5s from the last request
continue
return False
if resp.status_code < 300:
body = resp.json()
if body.get("status") == 1:
return True
print(f"pushover rejected the message: {body.get('errors')}") # input problem, do not retry
return False
if resp.status_code >= 500 and attempt == 0:
time.sleep(5)
continue
try:
errors = resp.json().get("errors")
except ValueError:
errors = resp.text[:80]
print(f"pushover refused the message: {resp.status_code} {errors}") # 4xx (incl. 429 quota) = input problem
return False
return False
def load_state() -> dict:
try:
with open(STATE_FILE, encoding="utf-8") as fh:
return json.load(fh)
except FileNotFoundError:
return {}
def save_state(state: dict) -> None:
tmp = STATE_FILE + ".tmp"
with open(tmp, "w", encoding="utf-8") as fh:
json.dump(state, fh, indent=1, sort_keys=True)
os.replace(tmp, STATE_FILE) # a crash mid-write keeps the last good state
def check(asins: list[str], token: str, user: str) -> None:
session, state = new_session(), load_state()
alerts, problems, checked, stopped = [], [], 0, ""
for asin in dict.fromkeys(a.strip().upper() for a in asins): # dedupe, keep order
if not ASIN_RE.match(asin):
problems.append(f"{asin}: not an ASIN, skipped")
continue
try:
key, detail = read_buy_box(session, asin)
except ApiError as err:
if err.status in (401, 403):
stopped = str(err) # bad key or no credits: every further call fails too
problems.append(f"stopped: {stopped}")
break
problems.append(f"{asin}: {err}") # 404 = listing gone (billed); state stays as it was
continue
except requests.RequestException as err:
problems.append(f"{asin}: {type(err).__name__} after retries, state kept")
continue
checked += 1
s = state.get(asin)
if s is None:
# first-ever sighting of this ASIN: seed state to it so a steady reading never alerts as a change
s = state[asin] = {"last": key, "streak": 1, "reported": key}
continue
s["streak"] = s["streak"] + 1 if key == s["last"] else 1
s["last"] = key
if s["streak"] >= CONFIRM and key != s["reported"]:
alerts.append((asin, key, line_for(asin, key, detail)))
lines = [line for _, _, line in alerts]
if stopped and state.get("_stopped") != stopped:
lines.append(f"STOP: checks stopped: {stopped}") # said once, not every run
sent = post_to_pushover(token, user, lines)
if sent:
for asin, key, _ in alerts:
state[asin]["reported"] = key # only after Pushover answered status 1, else re-sent
if stopped:
state["_stopped"] = stopped
if not stopped:
state.pop("_stopped", None)
save_state(state)
for line in problems:
print(line)
print(f"{checked} checked, {len(alerts)} alert(s) {'sent' if sent else 'NOT sent, retried next run'}")
if __name__ == "__main__":
check(ASINS, os.environ["PUSHOVER_TOKEN"], os.environ["PUSHOVER_USER"])
Five runs of the script (illustrative ASINs and sellers; [pushover] = the push sent)
--- run 1 (illustrative ASINs and sellers)
3 checked, 0 alert(s) sent
--- run 2, B0EXAMPLE2 lost (1st sighting, not yet confirmed)
3 checked, 0 alert(s) sent
--- run 3, same reading confirmed
[pushover] Amazon Buy Box change, confirmed on 2 checks: B0EXAMPLE2: LOST, held by Example Outlet (A2OTHERSELLER0, FBA) at 18.49 USD, your offer 19.99
3 checked, 1 alert(s) sent
--- run 4, back to mine (1st sighting, not yet confirmed)
3 checked, 0 alert(s) sent
--- run 5, back to mine, confirmed
[pushover] Amazon Buy Box change, confirmed on 2 checks: B0EXAMPLE2: BACK, you hold the Buy Box again
3 checked, 1 alert(s) sent
What the script actually POSTs (curl equivalent, illustrative values)
curl -s https://api.pushover.net/1/messages.json \
--form-string "token=$PUSHOVER_TOKEN" \
--form-string "user=$PUSHOVER_USER" \
--form-string "priority=1" \
--form-string "title=Amazon Buy Box change, confirmed on 2 checks" \
--form-string "message=B0EXAMPLE2: LOST, held by Example Outlet (A2OTHERSELLER0, FBA) at 18.49 USD"
# {"status": 1, "request": "6a4f...", ...}

How do I get a Pushover token and user key?
- Create a free Pushover accountSign up at pushover.net; the account itself and the API are free, only the device apps need a one-time license.
- Register an applicationOpen pushover.net/apps/build, name it (shown as the message title by default) and save. Pushover returns a 30-character API token.
- Copy your user keyYour personal user key is shown on your Pushover dashboard as soon as you log in; it is also 30 characters.
- Install a Pushover clientInstall the iOS, Android or desktop client and log in, so the account has at least one active device to receive the push.
Environment file and a cron entry for a 15-minute check (flock -n prevents overlapping runs)
# .env (keep it out of git: both keys are private and should never be shared or logged)
export SELLERMAGNET_API_KEY="your-key-here"
export PUSHOVER_TOKEN="azGDORePK8gMaC0QOYAMyEEuzJnyUi" # your application's token, 30 chars
export PUSHOVER_USER="uQiRzpo4DXghDmr9QzzfQu27cmVRsG" # your user (or group) key, 30 chars
export MY_SELLER_ID="A1MYSELLER0001" # your sellerId as it appears in offers[]
# crontab -e: every 15 minutes, 3 ASINs = 288 credits a day; flock -n skips a run while the last one still runs
*/15 * * * * cd /opt/buybox && . ./.env && flock -n .lock .venv/bin/python buybox_pushover_alert.py >> alert.log 2>&1
Pushover's own documentation (pushover.net/api, checked 2026-11-23) describes the contract the script relies on: a successful send answers an HTTP 2xx status with a JSON body carrying status: 1 and a request id; any 4xx response, or a 200 whose status is not 1, means your input was invalid (an over-quota account, an invalid token, an inactive user, a missing required parameter) and the docs say plainly that "repeating your same request will not work, no matter how many times you retry it" - that is a permanent failure, never retried here. A 500 or no reply at all is Pushover's own temporary problem, and the docs allow one retry of the exact same request, but "no sooner than 5 seconds" after the last attempt - the script waits exactly that long before its single retry. Messages are capped at 1024 UTF-8 characters with a 250-character title, and the account-wide quota is 10,000 free messages a month, shared by every application on the account, resetting at midnight Central Time on the 1st; once exhausted, further sends answer HTTP 429 until the reset.
What should you check when a LOST alert fires?
The alert tells you who holds the Buy Box and at what total price, not why Amazon featured that offer. Amazon's US help page Becoming the Featured Offer (Seller Central, checked 2026-10-23) lists what it weighs: the total price including shipping, a fast and specific delivery promise, free shipping, free returns and seller performance, and an out-of-stock offer cannot be featured. Its Featured Offer guide on sell.amazon.com adds that fulfilling orders yourself can be just as effective as FBA. Start with the gap between the holder's price and your offer in the push, then your delivery date and stock. Amazon's own guidance is on sell.amazon.com's Featured Offer page and Seller Central's "Becoming the Featured Offer" help article. The Buy Box price gap guide shows why the lowest price alone does not decide it.
How many credits does a Buy Box alert cost?
One offers call per ASIN per check, so the SellerMagnet cost is the number of ASINs times the number of checks; Pushover is separate and, at one push per confirmed change, stays far under its free monthly allowance for almost any tracking volume. With a 2-check confirmation the worst-case delay before Pushover hears about a loss is about two intervals. Errors add to the SellerMagnet bill in different ways: a 404 is billed once and not retried, a 502 or 503 is billed on every attempt, a 500 is refunded, and the free gate errors (400 for a missing parameter, 401, 403, 429) cost nothing. The Buy Box monitoring interval guide compares intervals in more detail, and Pricing lists the plans.
| Check interval | Credits per day | Credits per 30 days | Worst-case alert delay |
|---|---|---|---|
| Every 15 minutes | 96 | 2,880 | about 30 minutes |
| Every hour | 24 | 720 | about 2 hours |
| Every 4 hours | 6 | 180 | about 8 hours |
| Once a day | 1 | 30 | about 2 days |

Frequently Asked Questions
Do I need a Pushover subscription, or is the free tier enough?
The free tier is enough: each registered application may send 10,000 messages a month at no cost, and a one-time (not subscription) license unlocks the device apps. Checking one ASIN every 15 minutes with a 2-check confirmation uses at most a few hundred messages a month.
Does Pushover confirm the message was delivered to my phone?
No. A 2xx response with status 1 only means Pushover accepted the message for delivery to every active device on the account; it is not a read receipt or a device-delivery receipt. That is only tracked for emergency-priority (2) messages, which this alert does not use.
Why does the script wait for a second check before posting?
An offer page can come back without parsable offers, which looks like a stock-out. Waiting for the same reading on two checks in a row filters one-off readings at the cost of one interval.
What happens if I send more than 10,000 messages in a month?
Every further send for that application answers HTTP 429 with status 0 until the quota resets at 00:00:00 Central Time on the 1st of the next month. The script treats this as an input-class failure: it does not retry the identical request, and the unreported alert is sent again, unmodified, on the next run once the quota resets.
Can I page myself at night without Pushover staying silent during quiet hours?
Yes, with priority 1 (high priority), which the script sends by default: it bypasses quiet hours and always triggers sound and vibration. Priority 2 (emergency) goes further by repeating the alert until acknowledged, but needs retry/expire parameters and a receipt poll this one-shot alert does not use.
What happens when my SellerMagnet credits run out?
The API answers 401 (or 403 during a burst), which is not billed. The script stops instead of calling the remaining ASINs, sends one STOP message and does not repeat it until a run gets through without a 401 or 403.
Bottom line: compare buyBox.sellerId with your own seller ID, keep a streak per ASIN, and send one Pushover push per run with a token/user pair, no webhook server required. To see who held the Buy Box and for how long after the fact, use the Buy Box history API; a free account includes 150 credits to try the alert.