To get an Amazon Buy Box lost alert pushed through Pushbullet today, poll /amazon-product-offers for each of your ASINs, compare buyBox.sellerId with your own seller ID, and call POST /v2/pushes once per run: https://api.pushbullet.com/v2/pushes with type: "note", title, body and a client-set guid, authenticated by an Access-Token header, not a Bearer token or a secret baked into the URL. The script below tells a lost Buy Box apart from a suppressed one, de-dupes retried sends with the guid, and costs one SellerMagnet credit per ASIN per check.
Key Takeaways
- Authentication is a plain
Access-Token: <token>header, notAuthorization: Bearerand not a secret baked into the push URL like Mattermost or Rocket.Chat's webhook. - A successful
POST /v2/pushesanswers HTTP 200 with the full created push echoed back (iden,created,title,body,guid) - never a booleanok/successflag. - A client-set
guidmakes a retried send idempotent at the vendor itself: Pushbullet returns the earlier push instead of creating a duplicate - no other channel in this series offers that. - 401 (no valid token) and 403 (a valid token not authorized for this request) are two separate documented codes, unlike every sibling's single auth-failure status.
- buyBox is the featured offer: its sellerId is the seller who holds the Buy Box, the literal "Amazon" when Amazon does.
- Alert only when two checks in a row agree; 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 push.
How is Pushbullet's POST /v2/pushes different from Telegram, Gotify or Rocket.Chat?
Every other channel in this series answers a successful send with either a boolean flag (Telegram's ok, Rocket.Chat's {"success": true}) or, like Gotify and Webex, the full created object. Pushbullet does the latter, but is the only one of the two groups that also accepts a client-chosen guid on the way in: send the same guid twice and the API treats the second send as the same push instead of creating a new one (docs.pushbullet.com, checked 2026-11-27, "mostly idempotent"). Authentication is the Access-Token header, never Authorization: Bearer, and a failed call's body is always a nested error object with a machine-readable type (invalid_request or server), never a flat message string.
| Response | Reading | Pushbullet body |
|---|---|---|
| buyBox.sellerId is your sellerId | mine | BACK, after a confirmed return |
| 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 Pushbullet?
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_pushbullet() sends every queued line as one POST /v2/pushes call with a guid derived from the alert's own content and a one-minute time window. get_with_retry comes from retry.py and ApiError/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 429 is retried exactly once after a fixed backoff, since Pushbullet's own ratelimit headers carry no numeric wait time; a 401 or 403 stops without retry; the free-tier push-limit error is matched by message text since no dedicated status code exists for it; and the body is capped defensively since the API documents no hard limit on a note push's length.
buybox_pushbullet_alert.py - offers check, 2-check confirmation, one guid-tagged POST per run
import hashlib
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 Pushbullet 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
PUSHBULLET_API = "https://api.pushbullet.com/v2/pushes"
PUSHBULLET_TOKEN = os.environ["PUSHBULLET_ACCESS_TOKEN"]
MAX_BODY_CHARS = 4096 # Pushbullet's own docs state no hard cap on a note push's
# body; capped defensively so one run never sends an unbounded
# string to an API whose only documented size ceiling is the
# unrelated 26 MB file upload limit
MAX_LINES = 200
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:
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"held by {box.get('sellerName', 'unknown')} ({holder}, {box.get('fulfillment', '?')}) at {box.get('price')} {currency}"
return "lost", detail
def _load_state() -> dict:
try:
with open(STATE_FILE) as f:
return json.load(f)
except FileNotFoundError:
return {}
def _save_state(state: dict) -> None:
with open(STATE_FILE, "w") as f:
json.dump(state, f)
def check(session, state: dict) -> list[str]:
"""Advance the streak for every ASIN, return the lines to push this run (confirmed changes only)."""
lines = []
for asin in ASINS:
if not ASIN_RE.match(asin):
continue
reading, detail = read_buy_box(session, asin)
entry = state.get(asin)
if entry is None:
state[asin] = {"reading": reading, "streak": CONFIRM, "reported": reading} # seed, no false alert
continue
if entry["reading"] == reading:
entry["streak"] = min(entry["streak"] + 1, CONFIRM)
else:
entry["reading"], entry["streak"] = reading, 1
if entry["streak"] >= CONFIRM and entry["reported"] != reading:
entry["reported"] = reading
if reading == "lost":
lines.append(f"{asin}: LOST, {detail}")
elif reading == "mine":
lines.append(f"{asin}: BACK, you hold the Buy Box again")
return lines
def _push_guid(lines: list[str], window: int) -> str:
"""Deterministic guid from the alert content and a coarse time window, so a retried send after a
timeout (success/failure unknown) never creates a second push for the same confirmed change -
the ONLY channel in this series where the vendor itself de-dupes on the client's own guid."""
digest = hashlib.sha256(("\n".join(lines) + str(window)).encode()).hexdigest()[:24]
return f"buybox-{digest}"
def post_to_pushbullet(lines: list[str]) -> bool:
"""One POST /v2/pushes per run. Returns True if Pushbullet accepted it (sent or already-sent via guid)."""
if not lines:
return False
if len(lines) > MAX_LINES:
lines = lines[:MAX_LINES] + [f"...and {len(lines) - MAX_LINES} more"]
body = "Amazon Buy Box change, confirmed on 2 checks:\n" + "\n".join(lines)
if len(body) > MAX_BODY_CHARS:
body = body[:MAX_BODY_CHARS - 20] + "\n...(truncated)"
guid = _push_guid(lines, window=int(time.time() // 60))
payload = {"type": "note", "title": "Amazon Buy Box Alert", "body": body, "guid": guid}
resp = requests.post(
PUSHBULLET_API,
headers={"Access-Token": PUSHBULLET_TOKEN, "Content-Type": "application/json"},
data=json.dumps(payload),
timeout=30,
)
if resp.status_code == 200:
push = resp.json()
print(f"[pushbullet] iden={push.get('iden')} {body}")
return True
try:
err = resp.json().get("error", {})
except ValueError:
err = {}
err_type, message = err.get("type", "unknown"), err.get("message", "")
if resp.status_code == 429:
# Pushbullet's 429 carries no documented Retry-After/body field (unlike Telegram's retry_after or
# Zulip's JSON retry-after) - the generic X-Ratelimit-Reset header is the only signal, so one fixed
# backoff-and-retry is as precise as this API gets.
time.sleep(5)
resp = requests.post(
PUSHBULLET_API,
headers={"Access-Token": PUSHBULLET_TOKEN, "Content-Type": "application/json"},
data=json.dumps(payload),
timeout=30,
)
if resp.status_code == 200:
push = resp.json()
print(f"[pushbullet] iden={push.get('iden')} {body}")
return True
print(f"[pushbullet] still rate-limited after 1 retry, left unreported")
return False
if resp.status_code in (401, 403):
# 401 = no valid access token; 403 = a syntactically valid token not authorized for this request -
# the ONE channel in this series with two distinct auth-failure codes instead of one.
print(f"[pushbullet] STOP {resp.status_code} {err_type}: {message}")
return False
if err_type == "invalid_request" and "limit" in message.lower():
# the free-tier 500-pushes/month cap: Pushbullet's own docs say only "will result in an error", no
# dedicated status code - detected by matching the error message, not a status code.
print(f"[pushbullet] push limit reached this month, left unreported: {message}")
return False
print(f"[pushbullet] {resp.status_code} {err_type}: {message}, left unreported")
return False
def main() -> None:
session = new_session()
state = _load_state()
lines = check(session, state)
sent = post_to_pushbullet(lines)
_save_state(state)
print(f"{len(ASINS)} checked, {1 if sent else 0} alert(s) sent")
if __name__ == "__main__":
main()
Five runs of the script (illustrative ASIN and seller; [pushbullet] = the push sent)
--- run 1 (illustrative ASIN and seller)
1 checked, 0 alert(s) sent
--- run 2, B0EXAMPLE2 lost (1st sighting, not yet confirmed)
1 checked, 0 alert(s) sent
--- run 3, same reading confirmed
[pushbullet] iden=ujpah72o0abc Amazon Buy Box change, confirmed on 2 checks:
B0EXAMPLE2: LOST, held by Example Outlet (A2OTHERSELLER0, FBA) at 18.49 USD
1 checked, 1 alert(s) sent
--- run 4, back to mine (1st sighting, not yet confirmed)
1 checked, 0 alert(s) sent
--- run 5, back to mine, confirmed
[pushbullet] iden=ujpah72o0abc Amazon Buy Box change, confirmed on 2 checks:
B0EXAMPLE2: BACK, you hold the Buy Box again
1 checked, 1 alert(s) sent
What the script actually POSTs (curl equivalent, illustrative values)
curl -s -X POST https://api.pushbullet.com/v2/pushes \\
-H "Access-Token: o.testtoken12345" \\
-H "Content-Type: application/json" \\
-d '{"type": "note", "title": "Amazon Buy Box Alert", "guid": "buybox-9f2a1c0e8b3d4f5a6c7b8e9d",
"body": "Amazon Buy Box change, confirmed on 2 checks:
B0EXAMPLE2: LOST, held by Example Outlet (A2OTHERSELLER0, FBA) at 18.49 USD"}'
# {"iden": "ujpah72o0abc", "created": 1732701234.5, "type": "note", "title": "Amazon Buy Box Alert",
# "body": "...", "guid": "buybox-9f2a1c0e8b3d4f5a6c7b8e9d"}

How do I create a Pushbullet access token?
- Create a Pushbullet accountSign up at pushbullet.com and install the app on at least one device so you have somewhere to receive the push.
- Open Account SettingsLog into pushbullet.com, open the Account Settings page, and find the Access Tokens section.
- Create an access tokenClick Create Access Token. Pushbullet shows it once; it carries full account access, so store it like a password.
- Send a test push
curl --header "Access-Token: <token>" --header "Content-Type: application/json" --data-binary '{"type":"note","title":"test","body":"hello"}' --request POST https://api.pushbullet.com/v2/pushes; the response should echo back aniden.
Environment file and a cron entry for a 15-minute check (flock -n prevents overlapping runs)
# .env (keep it out of git: the access token has full account access, not scoped to pushes)
export SELLERMAGNET_API_KEY="your-key-here"
export PUSHBULLET_ACCESS_TOKEN="o.yourtokenhere12345" # created once in Account Settings, shown only then
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_pushbullet_alert.py >> alert.log 2>&1
Pushbullet's own API documentation (docs.pushbullet.com, checked 2026-11-27) describes the contract the script relies on: every successful call gets the full created push echoed back with a server-assigned iden, there is no ok/success flag anywhere in the response, auth failures split into 401 (no valid token) and 403 (a valid token not authorized for the request), and a guid sent twice is treated as the same push rather than creating a duplicate. There is no documented hard cap on a note push's body length; a 400 (missing parameter) or 401/403 are real input problems and must not be retried unchanged, while a 429 gets exactly one retry and a 5xx is logged and left for the next run.
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 message, then your delivery date and stock. 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; Pushbullet itself is free for this volume (the 500-pushes-a-month cap only matters if you send far more alerts than one push per confirmed change), unrelated to SellerMagnet credits. With a 2-check confirmation the worst-case delay before Pushbullet 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) 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 authenticate with a Bearer token like most other channels in this series?
No. Pushbullet's own API Overview (docs.pushbullet.com, checked 2026-11-27) uses a plain "Access-Token: <token>" header, not "Authorization: Bearer ..." and not a secret baked into the URL like Mattermost or Rocket.Chat. The token comes from the account's own Settings page and carries full account access, so it is read from an environment variable, never hardcoded.
Does a successful push answer with an ok or success field like Telegram or Rocket.Chat?
No. POST /v2/pushes answers HTTP 200 with the full created push object echoed back (iden, created, type, title, body, guid), the same convention as Gotify and Webex, never a boolean status flag. A failure answers a non-200 status with a nested {"error": {"type", "message", "param", "cat"}} object instead, where type is either invalid_request (client side) or server (Pushbullet's own side).
Why does the script send a guid with every push?
guid is a client-set idempotency key: Pushbullet's own docs say a push sent with a guid already seen "is unlikely to create another push" and instead returns the earlier one. That makes a retried send after a timeout, where the first attempt's outcome is unknown, safe to repeat. No other channel in this series exposes a client-chosen de-dupe key at the vendor itself; every sibling leaves that problem to the caller.
How is a 403 different from a 401 here?
docs.pushbullet.com lists both separately: 401 Unauthorized means no valid access token was sent at all, while 403 Forbidden means the token is valid but is not authorized for that particular request. Every other channel in this series collapses auth failures into one code; the script stops and reports the same way for both, but logs the status it actually got.
What happens on a 429?
Pushbullet's ratelimiting (docs.pushbullet.com "Limits", checked 2026-11-27) exposes X-Ratelimit-Limit/Remaining/Reset headers with a generic cost unit (a request costs 1, a database operation costs 4), but neither the docs nor a 429 response body carry a numeric wait time the way Telegram's retry_after or Zulip's retry-after field do. The script retries exactly once after a fixed 5-second backoff and gives up cleanly on a second 429.
What happens if I go over the free 500-pushes-a-month limit?
docs.pushbullet.com's Limits section says only that going over "will result in an error", with no dedicated status code documented. The script detects it by matching "limit" in the invalid_request error message and leaves the run unreported rather than guessing at a status code that is not specified.
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 push 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 Pushbullet POST /v2/pushes call per run with a client-set guid so a retry never duplicates it - check the echoed iden, never a boolean flag this API does not have. 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.