Quote exact phrases
Put multi-word names in quotes so you match the phrase and not each word.
Know when someone mentions your product on Reddit, minutes after they post. The whole thing is a search on a timer, a set of ids you have seen, and a webhook.
$0.50 free credit · Google sign-in · No card required
Ask for the 10 latest posts matching your term. That costs one request, and nothing if the page is empty.
Keep the ids from earlier polls. Anything not in that set is a new mention.
Post the title and link to Slack, email, or your own queue.
import os, time, requests
BASE = "https://api.apixstar.com/reddit/v1"
AUTH = {"Authorization": f"Bearer {os.environ['APIXSTAR_API_KEY']}"}
TERMS = ['"acme analytics"', "acmeanalytics.com"]
seen = set()
def check(term):
r = requests.get(f"{BASE}/search", params={"q": term, "sort": "new", "limit": 10},
headers=AUTH, timeout=30)
if not r.ok:
return # failed polls are not charged, try next round
for post in r.json()["data"]["posts"]:
if post["id"] not in seen:
seen.add(post["id"])
requests.post(os.environ["SLACK_WEBHOOK"],
json={"text": f"New mention: {post['title']} ({post['id']})"})
while True:
for term in TERMS:
check(term)
time.sleep(300) # every 5 minutes
Run the first pass without alerting, so the existing results fill seen and you only hear about new ones.
Cost depends on two numbers: how often you poll and how many searches you run. A poll that returns up to 10 results costs one request. Ask for a bigger page only if your term is busy.
| Setup | Requests per month | Cost per month |
|---|---|---|
| 1 keyword, every 15 minutes | 2,880 | $2.02 |
| 1 keyword, every 5 minutes | 8,640 | $6.05 |
| 1 keyword, every minute | 43,200 | $30 |
| 10 keywords, every 5 minutes | 86,400 | $60 |
| 50 keywords, every 5 minutes | 432,000 | $302 |
Fifty keywords every 5 minutes is 10 requests per minute, comfortably below the 30 requests per second limit when requests are spread out.
Put multi-word names in quotes so you match the phrase and not each word.
If your name is an ordinary word, search inside chosen subreddits only.
Fetch the post with its comments to see the context. It is one more request.
As fast as you poll. Reddit has no push stream, so every monitoring tool polls. A 5 minute interval finds a new post within 5 minutes on average.
Store the ids you have already seen and skip them. Sort by new so fresh posts arrive at the top of each response.
Yes. Add includeComments=true to a search, or poll specific threads you care about with the post endpoint.
One search every 5 minutes is 8,640 requests a month, which is $6.05. Polls that fail are not charged.
Search all of Reddit for a distinctive brand name. For a common word, search inside the subreddits where your audience is, or you will drown in unrelated matches.
$0.50 of free credit covers about 59 hours of polling one keyword every 5 minutes.
$0.50 free credit · Google sign-in · No card required