To get an Amazon Buy Box lost alert sent through GroupMe today, poll /amazon-product-offers for each of your ASINs, compare buyBox.sellerId with your own seller ID, and call POST /bots/post once per run: https://api.groupme.com/v3/bots/post with just bot_id and text (max 1,000 characters, the documented v3 text limit) in a JSON body, no auth header at all. A successful send answers HTTP 201 Created with an empty body, so unlike most of this series there is no JSON field to double-check - the script trusts the status code alone. The script below tells a lost Buy Box apart from a suppressed one, confirms a change on a second check, and costs one SellerMagnet credit per ASIN per check.
Key Takeaways
- Authentication is just the
bot_idstring inside the JSON body, no header, no token and no signature - the bot_id itself is the only credential the endpoint checks. - A successful
POST /bots/postanswers HTTP 201 Created with no response body at all, the opposite problem from Viber or Lark earlier in this series, where the HTTP code lies and the real outcome sits in a JSON field the script has to read. - A bot is created against exactly one group; there is no per-call group parameter, so alerting a second group means registering a second bot and a second
GROUPME_BOT_ID. - The user-token
source_guidde-dup field does not exist on the bot endpoint, so a retried send after a timeout can double-post; the script only retries the one documented transient status (420, "Enhance Your Calm") and leaves every other failure for the next run. - 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 send.
How is GroupMe's empty-body response different from Lark, Viber or Telegram?
Every other channel in this series puts the real outcome in a JSON field riding inside the HTTP response: Lark and Viber both answer HTTP 200 for success and failure alike and hide the truth in a code/status number, and Telegram's ok flag still travels inside a 200 body. GroupMe (dev.groupme.com, checked 2026-11-28) flips the problem: the success response for /bots/post is documented as plain Status: 201 Created with no body shown, while a failure still answers with the standard GroupMe error envelope ({"meta": {"code": ..., "errors": [...]}}) on a 4xx. A script that tries to call .json() on every response to confirm delivery, the way the Lark and Viber scripts in this series do, would crash on its first successful send.
| Response | Reading | GroupMe message |
|---|---|---|
| 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 GroupMe?
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_groupme() sends every queued line as one POST /bots/post call and reads only the HTTP status code to decide what happened. 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. Only HTTP 420 (Enhance Your Calm) is retried, once, after a fixed backoff, because it is the one status GroupMe documents as transient; 400 and 404 stop without retry since nothing about retrying changes a malformed body or a bot_id that was never valid or has since been deleted; and the body is capped at the same 1,000-character text limit the v3 docs state for a message (documented on the user-token /messages endpoint; /bots/post lists no cap of its own, so the script applies the same limit defensively).
buybox_groupme_alert.py - offers check, 2-check confirmation, one status-checked POST 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 GroupMe 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
GROUPME_API = "https://api.groupme.com/v3/bots/post"
GROUPME_BOT_ID = os.environ["GROUPME_BOT_ID"] # from dev.groupme.com; tied to exactly one group, no auth header
MAX_BODY_CHARS = 1000 # dev.groupme.com/docs/v3: the /messages text parameter caps
# at 1,000 characters; /bots/post lists no explicit cap of its
# own, so the same documented v3 text limit is used defensively
MAX_LINES = 40 # keeps the batch comfortably under the 1,000-char text limit
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('fulfillmentType', '?')}) at {box.get('totalPrice')} {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 post_to_groupme(lines: list[str]) -> bool:
"""One POST per run to /bots/post. dev.groupme.com's own docs (checked 2026-11-28) show the success
response as plain `Status: 201 Created` with no response body at all - the opposite problem from most
of this series, where the result lives in a JSON field: here there is no JSON to read even on success,
so the script trusts the HTTP status alone and nothing else. A bad request or outage still answers with
a body (a standard `{"meta": {...}}` error envelope on 4xx, nothing parseable on 5xx), so the body is
only ever inspected on a non-2xx response, never relied on to confirm delivery."""
if not lines:
return False
if len(lines) > MAX_LINES:
lines = lines[:MAX_LINES] + [f"...and {len(lines) - MAX_LINES} more"]
text = "Amazon Buy Box change, confirmed on 2 checks:\n" + "\n".join(lines)
if len(text) > MAX_BODY_CHARS:
text = text[:MAX_BODY_CHARS - 20] + "\n...(truncated)"
payload = {"bot_id": GROUPME_BOT_ID, "text": text}
resp = requests.post(GROUPME_API, headers={"Content-Type": "application/json"},
data=json.dumps(payload), timeout=30)
if resp.status_code == 201:
# No body to read: a bot post has no source_guid de-dup either (that field only exists on the
# user-token /messages endpoint), so a retried send after a real timeout can double-post. The
# script only retries the one documented transient status (420) and never retries a timeout.
print(f"[groupme] {text}")
return True
if resp.status_code == 420:
# dev.groupme.com/docs/responses: "Enhance Your Calm" - rate limited. One fixed backoff-and-retry.
time.sleep(5)
resp = requests.post(GROUPME_API, headers={"Content-Type": "application/json"},
data=json.dumps(payload), timeout=30)
if resp.status_code == 201:
print(f"[groupme] {text}")
return True
print(f"[groupme] still HTTP {resp.status_code} after 1 retry, left unreported")
return False
if resp.status_code in (400, 404):
# bad payload or an unknown/deleted bot_id - a setup problem, retrying the same body cannot fix it.
print(f"[groupme] STOP HTTP {resp.status_code}, left unreported")
return False
print(f"[groupme] HTTP {resp.status_code}, left unreported")
return False
def main() -> None:
session = new_session()
state = _load_state()
lines = check(session, state)
sent = post_to_groupme(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; [groupme] = the message 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
[groupme] 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
[groupme] 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.groupme.com/v3/bots/post \\
-H "Content-Type: application/json" \\
-d '{"bot_id": "j5abcdefg0001example",
"text": "Amazon Buy Box change, confirmed on 2 checks:
B0EXAMPLE2: LOST, held by Example Outlet (A2OTHERSELLER0, FBA) at 18.49 USD"}'
# HTTP/1.1 201 Created
# (empty body)

How do I create a GroupMe bot and bot_id?
- Register a bot on dev.groupme.comSign in with your GroupMe account at dev.groupme.com/bots, click "Create Bot", pick the group it should post into and give it a name; the bot is tied to that one group for its whole life.
- Copy the bot_idThe bot's detail page on dev.groupme.com shows a
bot_idstring. That is the only credential/bots/postchecks - no token, no header. - Send a test message
curl -X POST -H \\"Content-Type: application/json\\" -d '{\\"bot_id\\":\\"<bot_id>\\",\\"text\\":\\"hello\\"}' https://api.groupme.com/v3/bots/post; a successful call answersHTTP/1.1 201 Createdwith no body, and the message appears in the group immediately. - Confirm delivery by eye, not by bodyBecause the success response carries nothing to parse, the first real check that the bot_id and group are right is seeing the test message land in the GroupMe app itself.
Environment file and a cron entry for a 15-minute check (flock -n prevents overlapping runs)
# .env (keep it out of git: the bot_id alone is enough for anyone to post into that group)
export SELLERMAGNET_API_KEY="your-key-here"
export GROUPME_BOT_ID="j5abcdefg0001example" # from the bot's page on dev.groupme.com
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_groupme_alert.py >> alert.log 2>&1
GroupMe's own developer documentation (dev.groupme.com/docs/v3 and dev.groupme.com/docs/responses, checked 2026-11-28) describes the contract the script relies on: /bots/post needs only bot_id and text (no cap stated on that specific endpoint; the v3 docs state a 1,000-character maximum for the equivalent text field on the user-token /messages call, which the script applies here too as a defensive limit), a successful call answers plain Status: 201 Created with no response body, and the shared status-code table documents 420 by the literal name "Enhance Your Calm" for rate limiting alongside the usual 400/401/403/404/500/502/503 set. There is no per-message idempotency key on this endpoint - source_guid de-dup only exists on the separate user-token /messages call - so a 400 or 404 are real setup problems that must not be retried unchanged, while 420 gets exactly one retry and a timeout is left for the next scheduled run instead of guessed at.
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; GroupMe itself is free for this volume, unrelated to SellerMagnet credits. With a 2-check confirmation the worst-case delay before GroupMe 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
Does a successful GroupMe bot post return any JSON to check, like Lark or Viber?
No. dev.groupme.com's own bot API reference (checked 2026-11-28) documents the success response for POST /bots/post as plain Status: 201 Created with no body shown at all - unlike almost every other GroupMe v3 endpoint, which answers inside a {"meta": {...}, "response": {...}} envelope. This is the opposite problem from Viber or Lark earlier in this series, where the HTTP code lies and the real result sits in a JSON field: here there is no JSON on success, so the script has nothing to parse and trusts the HTTP status alone.
Can a bot post to more than one group?
No. A bot_id from dev.groupme.com is created against exactly one group at bot-creation time and keeps posting into that same group for its whole life; there is no per-call group parameter on /bots/post, only bot_id and text. Alerting more than one group means registering a separate bot (and a separate GROUPME_BOT_ID) for each.
Is there anything like Lark's sign or Viber's auth-token header for a bot post?
No. The bot_id in the JSON body is the only credential GroupMe's bot endpoint checks; there is no auth header, no HMAC signature and no separate access token for this specific call. That also means a leaked bot_id lets anyone post into that one group until the bot is deleted on dev.groupme.com.
Does a retried send risk a duplicate message, the way Viber's lack of an idempotency key does?
Yes, and GroupMe's bot endpoint has even less protection than Viber. The v3 docs define a client-set source_guid that lets the server de-duplicate two sends within one minute, but that field only exists on the user-token /groups/{id}/messages endpoint, not on /bots/post. A bot send has no de-dupe key at all, so the script only retries the one status GroupMe documents as transient (420) and leaves a timeout for the next scheduled run instead of retrying blind.
What does HTTP 420 mean here, and is it really used?
dev.groupme.com/docs/responses lists 420 under the literal label "Enhance Your Calm" as the code returned when a caller is being rate limited, next to the standard 400/401/403/404/500/502/503 set. The script treats it exactly like any other documented transient status: one fixed 5-second backoff and a single retry, then it gives up for that run.
Bottom line: compare buyBox.sellerId with your own seller ID, keep a streak per ASIN, and send one GroupMe POST /bots/post call per run - the only thing to check is the HTTP status code, since a success carries no body at all. 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.