<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Wryborg Blog]]></title><description><![CDATA[Wryborg Blog]]></description><link>https://wryborg.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 21:11:12 GMT</lastBuildDate><atom:link href="https://wryborg.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[OFAC screening in 10 lines of Python]]></title><description><![CDATA[Name screening against the U.S. Treasury OFAC lists can start with a single HTTP request. The Wryborg Sanctions Watch API exposes fuzzy name screening as…]]></description><link>https://wryborg.hashnode.dev/ofac-screening-in-10-lines</link><guid isPermaLink="true">https://wryborg.hashnode.dev/ofac-screening-in-10-lines</guid><category><![CDATA[Python]]></category><category><![CDATA[api]]></category><category><![CDATA[Security]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[Wryborg]]></dc:creator><pubDate>Sat, 28 Nov 2026 19:10:25 GMT</pubDate><content:encoded><![CDATA[<p>Name screening against the U.S. Treasury OFAC lists can start with a single HTTP request. The <a href="https://wryborg.com/pricing/sanctions-watch/">Wryborg Sanctions Watch API</a> exposes fuzzy name screening as <code>GET /screen</code>. This post shows a 10-line Python caller, then the caveats you should not skip.</p>
<p>A match is not a legal determination, and no match is not a clearance. Scores are candidate rankings for triage, not an identity determination. A screening result is not a sanctions determination and is not legal advice. Always confirm the official list at <code>source_url</code>.</p>
<h2>Get a Sanctions Watch key</h2>
<ol>
<li>Create an account at <a href="https://wryborg.com/account/signup">wryborg.com/account/signup</a>.</li>
<li>Verify your email.</li>
<li>Subscribe to Sanctions Watch (a free tier is available, and it includes fuzzy name screening). If you choose a paid plan, payment is handled by Stripe.</li>
<li>Copy the key from your <a href="https://wryborg.com/account">account</a>. It starts with <code>wrb_</code> and is not emailed.</li>
</ol>
<p>Each Wryborg API is its own subscription and its own key. A key issued for a different API, such as Food Recall Monitor, returns <code>403</code> with <code>error.code</code> <code>api_mismatch</code> on this one. Plans and quotas are on the <a href="https://wryborg.com/pricing/sanctions-watch/">Sanctions Watch pricing page</a>.</p>
<pre><code class="language-bash">export WRYBORG_API_KEY=wrb_your_key
python3 -m pip install requests
</code></pre>
<p>Interactive docs are at <a href="https://api.wryborg.com/sanctions/v1/docs">api.wryborg.com/sanctions/v1/docs</a>. The OpenAPI document is at <a href="https://api.wryborg.com/sanctions/v1/openapi.json">api.wryborg.com/sanctions/v1/openapi.json</a>. Curl, Python, and JavaScript samples live in <a href="https://github.com/wryborg/wryborg-api-examples">github.com/wryborg/wryborg-api-examples</a>. A runnable Postman collection is in the public <a href="https://www.postman.com/wryborg-6585777/wryborg-apis/overview">Wryborg APIs workspace</a>.</p>
<p>The base URL is <code>https://api.wryborg.com/sanctions/v1</code>. Send the key in the <code>X-API-Key</code> header. By default, <code>/screen</code> searches the OFAC SDN and Consolidated lists. UK, EU, UN, Canada, and Australia lists are included when you set the <code>jurisdiction</code> parameter (<code>US</code>, <code>EU</code>, <code>GB</code>, <code>CA</code>, <code>AU</code>, <code>UN</code>, a comma-separated list, or <code>all</code>). <a href="https://main.un.org/securitycouncil/en/content/un-sc-consolidated-list">Contains data from the United Nations Security Council Consolidated List.</a> The lists are re-read about every six hours.</p>
<p>PEP and adverse media are documented as unsupported coverage, not live feeds. <code>GET /health</code> and <code>GET /sources</code> are public and do not need a key. <code>/sources</code> reports which lists are loaded and which screening types are unavailable.</p>
<h2>Ten lines</h2>
<p><code>name</code> is the only required query parameter. <code>min_score</code> defaults to 85 (allowed range 50â€“100). <code>limit</code> defaults to 10 and caps at 50. Omitted <code>jurisdiction</code> stays on OFAC.</p>
<pre><code class="language-python">import os, requests
r = requests.get("https://api.wryborg.com/sanctions/v1/screen",
                 headers={"X-API-Key": os.environ["WRYBORG_API_KEY"]},
                 params={"name": "Example Name"}, timeout=30)
r.raise_for_status()
data = r.json()
print(data["result"], data["complete"], data["count"], data["total"])
for m in data["matches"]:
    e = m["entry"]
    print(m["score"], m["matched_name"], e["id"], e["source_url"])
</code></pre>
<p>Replace <code>"Example Name"</code> with the full name you want to screen. An empty <code>matches</code> array is still a successful, billable <code>200</code>. That is not a clearance.</p>
<p>The same call in curl:</p>
<pre><code class="language-bash">curl -sS -H "X-API-Key: ${WRYBORG_API_KEY}" \
  --get --data-urlencode "name=Example Name" \
  "https://api.wryborg.com/sanctions/v1/screen"
</code></pre>
<h2>What comes back</h2>
<p>A successful screen response includes <code>query</code>, <code>min_score</code>, <code>count</code>, <code>total</code>, <code>matches</code>, and <code>disclaimer</code>. It also includes <code>adjudication</code> (default <code>not_performed</code>), <code>clearance</code> (null), <code>result</code>, <code>coverage</code>, <code>complete</code>, and <code>warnings</code>. <code>count</code> is how many matches this response returns. <code>total</code> is every match at or above <code>min_score</code>. When <code>total</code> is greater than <code>count</code>, the page is truncated.</p>
<p>Each match includes <code>score</code>, <code>matched_name</code>, and <code>entry</code>, and may include <code>score_method</code> (default <code>token_sort_ratio</code>), <code>matched_field</code>, <code>matched_name_raw</code>, <code>explanation</code>, and <code>identity_determination</code> (default <code>false</code>). The <code>entry</code> object documents <code>id</code>, <code>source</code>, <code>source_url</code>, <code>retrieved_at</code>, and <code>last_verified_at</code>. The schema allows additional list fields on <code>entry</code>. For an OFAC entry, <code>source_url</code> is that entry's Sanctions List Search details page (<code>https://sanctionssearch.ofac.treas.gov/Details.aspx?id=</code> plus the numeric uid).</p>
<p><code>result</code> is one of <code>no_candidates</code>, <code>incomplete</code>, <code>candidates</code>, or <code>candidates_incomplete</code>. Use that field, and <code>complete</code>, rather than treating an empty <code>matches</code> list as a pass.</p>
<p>The following JSON is <strong>illustrative of the documented schema</strong>, not a live API response. Do not treat the names, scores, or ids as a real screening result.</p>
<pre><code class="language-json">{
  "query": "Example Name",
  "min_score": 85,
  "count": 1,
  "total": 1,
  "matches": [
    {
      "score": 100,
      "matched_name": "EXAMPLE NAME",
      "score_method": "token_sort_ratio",
      "identity_determination": false,
      "entry": {
        "id": "sdn-12345",
        "source": "OFAC SDN List",
        "source_url": "https://sanctionssearch.ofac.treas.gov/Details.aspx?id=12345",
        "retrieved_at": "2026-11-02T11:40:18+00:00",
        "last_verified_at": "2026-11-02T17:40:18+00:00"
      }
    }
  ],
  "disclaimer": "&lt;the API's screening disclaimer; always confirm the official list at source_url&gt;",
  "adjudication": "not_performed",
  "clearance": null,
  "result": "candidates",
  "complete": true
}
</code></pre>
<h2>Caveats you should not skip</h2>
<p><strong>Use a full name.</strong> A single token that exactly equals one whole token of a name or alias, after case, diacritic, and transliteration normalization, scores 90 when that token is at least three characters and is not a generic token such as Bank, Company, Group, or Ltd. That clears the default <code>min_score</code> of 85. It does not score 100, and <code>min_score=100</code> does not return those surname-only hits. An exact full name stays on <code>token_sort_ratio</code> at 100. In short: a surname alone can rank above the default cutoff, and the API will warn you on some single-token queries.</p>
<p><strong>A human has to review candidates.</strong> <code>identity_determination</code> defaults to <code>false</code>. <code>adjudication</code> defaults to <code>not_performed</code>. <code>clearance</code> is null. The API is ranking possible matches for triage. It is not deciding that the person or entity you screened is, or is not, the listed party.</p>
<p><strong><code>/screen</code> does not take a date of birth or a country.</strong> A candidate is not disambiguated that way. If you have those attributes, use them in your own review against the official entry at <code>source_url</code>.</p>
<p><strong>No match is not a clearance.</strong> <code>result: "no_candidates"</code> means this snapshot produced no rows at or above <code>min_score</code>, not that the name is cleared. If a source in scope is failed, stale, or unloaded, the screen may be <code>incomplete</code> or <code>candidates_incomplete</code>. <code>allow_incomplete=true</code> returns a billed partial screen in that situation; the default is to avoid presenting a partial result as complete.</p>
<p><strong>The data may be delayed or incomplete.</strong> OFAC data is derived from official U.S. government records (the SDN and Consolidated lists). Other jurisdictions use their official lists when requested. Sanctions Watch re-reads those list files about every six hours, so a name that appeared on a list in the last few hours may not be in the current snapshot. <code>retrieved_at</code> is when ingest first stored the entry; <code>last_verified_at</code> is when ingest last rechecked it. <code>GET /sources</code> and <code>GET /health</code> show load status and the last successful ingest per source.</p>
<p><strong>This is not legal advice</strong>, and Wryborg is not affiliated with OFAC or any other list publisher. The official list at <code>source_url</code> controls. False positives happen; fuzzy scores are expected to. Build a review step before you block, file, or tell a customer that someone is sanctioned.</p>
<p><strong>Watch <code>total</code> and <code>warnings</code>.</strong> If more matches exist than <code>limit</code>, raise <code>limit</code> (the maximum is 50). When <code>limit</code> is already 50, a warning tells you that is the cap. Those warnings are omitted when there is nothing to add.</p>
<p><strong>Other jurisdictions are opt-in.</strong> Add <code>jurisdiction=all</code> (or a comma-separated list) only when you intend to search them, and keep the <a href="https://main.un.org/securitycouncil/en/content/un-sc-consolidated-list">UN Security Council Consolidated List</a> attribution. On a public <code>GET /sources</code> check on 22 November 2026 (America/New_York), OFAC SDN and Consolidated were reported as <code>supported</code>; the UK, Canada, Australia, EU, and UN lists were reported as <code>partial</code>. Confirm current coverage against <code>/sources</code> rather than assuming it is unchanged.</p>
<p><strong><code>GET /entries</code> is not the free-plan screen.</strong> Browsing stored entries is documented as Pro and above. Free plans use <code>/screen</code>. A missing or unrecognized key is <code>401</code> (<code>missing_api_key</code> or <code>invalid_api_key</code>). Failed authentication is rate limited (30 failures per IP, and 300 across all IPs, each minute).</p>
<p>Sanctions Watch currently allows any browser origin (<code>Access-Control-Allow-Origin: *</code>). Do not put a key in a public web page anyway.</p>
<h2>Further reading</h2>
<ul>
<li><a href="https://wryborg.com/">Wryborg</a> and <a href="https://wryborg.com/pricing/">pricing</a></li>
<li><a href="https://wryborg.com/account/signup">Create an account</a></li>
<li><a href="https://api.wryborg.com/sanctions/v1/docs">Sanctions Watch docs</a></li>
<li><a href="https://github.com/wryborg/wryborg-api-examples">Code samples on GitHub</a></li>
<li><a href="https://www.postman.com/wryborg-6585777/wryborg-apis/overview">Wryborg APIs Postman workspace</a></li>
<li><a href="https://main.un.org/securitycouncil/en/content/un-sc-consolidated-list">UN Security Council Consolidated List</a></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Build a food-recall allergen alert in Python]]></title><description><![CDATA[If you need to know when a U.S. food recall mentions peanut, milk, or another major allergen, you can poll the Wryborg Food Recall Monitor API and alert on…]]></description><link>https://wryborg.hashnode.dev/food-recall-allergen-alerts</link><guid isPermaLink="true">https://wryborg.hashnode.dev/food-recall-allergen-alerts</guid><category><![CDATA[Tutorial]]></category><category><![CDATA[Python]]></category><category><![CDATA[api]]></category><category><![CDATA[food ]]></category><dc:creator><![CDATA[Wryborg]]></dc:creator><pubDate>Sat, 28 Nov 2026 19:08:26 GMT</pubDate><content:encoded><![CDATA[<p>If you need to know when a U.S. food recall mentions peanut, milk, or another major allergen, you can poll the <a href="https://wryborg.com/pricing/food-recall/">Wryborg Food Recall Monitor API</a> and alert on records you have not already seen. This post builds a short Python script that does that, with a curl and Node.js aside.</p>
<p>The data is derived from official U.S. government records: FDA openFDA food enforcement reports and USDA FSIS recall notices. It may be delayed or incomplete and is not a safety guarantee. Always confirm the original notice (<code>source_url</code>). Allergen tags, product categories, and distribution states are derived during ingest and can be wrong.</p>
<h2>Get a Food Recall Monitor key</h2>
<ol>
<li>Create an account at <a href="https://wryborg.com/account/signup">wryborg.com/account/signup</a>.</li>
<li>Verify your email.</li>
<li>Subscribe to Food Recall Monitor (a free tier is available). If you choose a paid plan, payment is handled by Stripe.</li>
<li>Copy the key from your <a href="https://wryborg.com/account">account</a>. It starts with <code>wrb_</code> and is not emailed.</li>
</ol>
<p>Each Wryborg API is its own subscription and its own key. A Food Recall Monitor key returns <code>403</code> on the others. See <a href="https://wryborg.com/pricing/food-recall/">pricing</a> for plans and quotas.</p>
<pre><code class="language-bash">export WRYBORG_API_KEY=wrb_your_key
python3 -m pip install requests
</code></pre>
<p>Docs: <a href="https://api.wryborg.com/v1/docs">api.wryborg.com/v1/docs</a> and <a href="https://api.wryborg.com/v1/openapi.json">openapi.json</a>. Samples: <a href="https://github.com/wryborg/wryborg-api-examples">github.com/wryborg/wryborg-api-examples</a>. Postman: <a href="https://www.postman.com/wryborg-6585777/wryborg-apis/overview">Wryborg APIs workspace</a>.</p>
<h2>What the API lets you filter</h2>
<p>The list endpoint is <code>GET https://api.wryborg.com/v1/recalls</code>. Food is served at <code>/v1</code> on <code>api.wryborg.com</code>; there is no <code>/food</code> prefix. Send the key in the <code>X-API-Key</code> header.</p>
<p>The <code>allergen</code> query parameter accepts the nine FDA major food allergens (FALCPA + FASTER Act): <code>milk</code>, <code>egg</code>, <code>peanut</code>, <code>tree_nut</code>, <code>soy</code>, <code>wheat</code>, <code>fish</code>, <code>shellfish</code>, and <code>sesame</code>. Values are case-insensitive. Spaces, hyphens, and a trailing plural are accepted (<code>tree nut</code> and <code>peanuts</code> both work). <code>GET /allergens</code> returns the same codes, a display name, and a <code>recall_count</code> for each.</p>
<p>There is no <code>allergen=undeclared</code> filter. That value returns <code>422</code> with <code>error.code</code> <code>invalid_parameter</code> and lists the nine allowed values. Many allergen recalls are labeling cases, and "undeclared" usually appears in <code>reason</code> (for example, <code>undeclared allergen ingredient (Peanuts, Milk)</code>). Filter those client-side after you fetch by allergen. Do not use <code>q=undeclared</code> as a stand-in: <code>q</code> searches firm, product, and reason, and it also matches undeclared drug ingredients.</p>
<p>Useful companions to <code>allergen</code> are <code>state</code> (a 2-letter code or full name; a state filter also returns <code>NATIONWIDE</code> recalls), <code>date_from</code> / <code>date_to</code> (<code>report_date</code> as <code>YYYY-MM-DD</code>), <code>sort</code> (default <code>-report_date</code>; also <code>report_date</code>, <code>recall_initiation_date</code>, <code>-recall_initiation_date</code>), <code>limit</code> (1â€“100, default 25), and <code>offset</code>. <code>classification</code>, <code>status</code>, <code>source</code>, <code>brand</code>, <code>product_category</code>, and <code>q</code> are in the OpenAPI file.</p>
<p>The corpus is refreshed about every six hours, so polling more often mostly repeats the same page and still counts against your monthly quota. A successful list, including an empty page, is one billed call. <code>GET /health</code> is public. <code>GET /usage</code> reports quota and does not consume a call. The free plan covers the last 12 months; if <code>date_from</code> is earlier than your plan window, the response adds <code>warnings</code> and an <code>X-History-Clamped</code> header. <code>history_from</code> is the earliest <code>report_date</code> your plan may read, or <code>null</code> when the plan has full history.</p>
<p>Food Recall Monitor does not allow arbitrary browser origins. Run this on a server or your laptop, not from a public web page.</p>
<h2>The list response</h2>
<p>A successful page includes <code>total</code>, <code>limit</code>, <code>offset</code>, <code>plan</code>, <code>history_from</code>, <code>warnings</code>, <code>data</code>, and <code>disclaimer</code>. Each recall includes provenance (<code>source</code>, <code>source_url</code>, <code>retrieved_at</code>, <code>last_verified_at</code>) plus fields such as <code>firm</code>, <code>brand</code>, <code>product_description</code>, <code>product_category</code>, <code>allergens</code>, <code>classification</code>, <code>status</code>, <code>reason</code>, and <code>distribution_states</code>.</p>
<p>Here is a shortened live response for <code>allergen=peanut</code>, fetched on 22 November 2026 (America/New_York). <code>plan</code> is a placeholder, and several fields are omitted. <code>total</code> will change as the corpus is refreshed.</p>
<pre><code class="language-json">{
  "total": 1195,
  "limit": 5,
  "offset": 0,
  "plan": "&lt;your_plan&gt;",
  "warnings": [],
  "data": [
    {
      "id": "fda-H-0112-2027",
      "source": "FDA",
      "source_url": "https://api.fda.gov/food/enforcement.json?search=recall_number:%22H-0112-2027%22",
      "report_date": "2026-10-28",
      "firm": "El Ruisenor De Mexico, Inc.",
      "product_description": "Butter Toffee Peanuts; packed in a clear plastic bag. 1lb, 5lb, 50lb unit size. No UPC",
      "allergens": ["milk", "peanut"],
      "classification": "Class III",
      "distribution_states": ["CA", "HI", "IL", "KS", "NV", "OR", "WA"],
      "reason": "undeclared allergen ingredient (Peanuts, Milk)"
    }
  ],
  "disclaimer": "Data is derived from official U.S. FDA (openFDA food enforcement reports) and USDA FSIS recall notices. It is provided as-is, may be delayed or incomplete, and is not a safety guarantee. Always confirm with the original notice (source_url)."
}
</code></pre>
<h2>The script</h2>
<p>Save the following as <code>allergen_alerts.py</code>. It requests recalls for one major allergen whose <code>report_date</code> falls in a rolling 30-day window, prints any <code>id</code> it has not stored, and writes those ids to <code>seen-recall-ids.json</code>.</p>
<pre><code class="language-python">#!/usr/bin/env python3
import json, os, sys
from datetime import date, timedelta
from pathlib import Path
import requests

API_KEY = os.environ.get("WRYBORG_API_KEY")
if not API_KEY:
    sys.exit("Set WRYBORG_API_KEY to your wrb_ key from https://wryborg.com/account/signup")

ALLERGEN = os.environ.get("ALLERGEN", "peanut")
DAYS = int(os.environ.get("LOOKBACK_DAYS", "30"))
STATE_FILE = Path("seen-recall-ids.json")
BASE = "https://api.wryborg.com/v1"

date_from = (date.today() - timedelta(days=DAYS)).isoformat()
response = requests.get(
    f"{BASE}/recalls",
    headers={"X-API-Key": API_KEY},
    params={
        "allergen": ALLERGEN,
        "date_from": date_from,
        "sort": "-report_date",
        "limit": 100,
    },
    timeout=30,
)
if not response.ok:
    err = response.json().get("error") if response.headers.get("content-type", "").startswith("application/json") else response.text
    sys.exit(f"HTTP {response.status_code}: {err}")

payload = response.json()
seen = set(json.loads(STATE_FILE.read_text())) if STATE_FILE.exists() else set()
new_rows = [row for row in payload["data"] if row["id"] not in seen]

if not new_rows:
    print(f"No new {ALLERGEN} recalls since {date_from} (checked {len(payload['data'])} row(s)).")
else:
    print(f"{len(new_rows)} new {ALLERGEN} recall(s) since {date_from}:\n")
    for recall in new_rows:
        print(f"New {recall.get('classification')} recall {recall['id']} ({recall['source']})")
        print(f"  Report date: {recall.get('report_date')}")
        print(f"  Firm: {recall.get('firm')}")
        print(f"  Product: {recall.get('product_description')}")
        print(f"  Allergens: {', '.join(recall.get('allergens') or [])}")
        print(f"  States: {', '.join(recall.get('distribution_states') or [])}")
        print(f"  Reason: {recall.get('reason')}")
        print(f"  Confirm: {recall['source_url']}\n")

for row in payload["data"]:
    seen.add(row["id"])
STATE_FILE.write_text(json.dumps(sorted(seen), indent=2) + "\n")
</code></pre>
<p>The first time you run it, every recall in the lookback window is new. Later runs only print unseen ids. This live 30-day run was from 22 November 2026 (America/New_York):</p>
<pre><code class="language-text">5 new peanut recall(s) since 2026-10-23:

New Class III recall fda-H-0112-2027 (FDA)
  Report date: 2026-10-28
  Firm: El Ruisenor De Mexico, Inc.
  Product: Butter Toffee Peanuts; packed in a clear plastic bag. 1lb, 5lb, 50lb unit size. No UPC
  Allergens: milk, peanut
  States: CA, HI, IL, KS, NV, OR, WA
  Reason: undeclared allergen ingredient (Peanuts, Milk)
  Confirm: https://api.fda.gov/food/enforcement.json?search=recall_number:%22H-0112-2027%22

python3 allergen_alerts.py
No new peanut recalls since 2026-10-23 (checked 5 row(s)).
</code></pre>
<p>Set <code>ALLERGEN</code> and <code>LOOKBACK_DAYS</code> to change the filter, or add a <code>state</code> query parameter (for example <code>CA</code>). To keep only undeclared-labeling cases, drop rows whose <code>reason</code> does not contain <code>"undeclared"</code> before you compare ids.</p>
<p>This watches <code>report_date</code>. It will not notice a field change on an older recall outside the window, and it is not a substitute for the official change feed. <code>GET /recalls/changes</code> lists created and updated recalls since a UTC timestamp (<code>since</code> is required) and pages with <code>after_seq</code> / <code>next_seq</code>. That endpoint requires Ultra or Mega; other plans get <code>403</code> with <code>error.code</code> <code>plan_upgrade_required</code>, and that <code>403</code> is not billed.</p>
<h2>Optional Slack webhook</h2>
<p>Inside the <code>for recall in new_rows:</code> loop, build <code>text</code> from the same fields you printed, then POST it to a Slack incoming webhook:</p>
<pre><code class="language-python">text = "\n".join(
    [
        f"New {recall.get('classification')} recall {recall['id']} ({recall['source']})",
        f"  Product: {recall.get('product_description')}",
        f"  Reason: {recall.get('reason')}",
        f"  Confirm: {recall['source_url']}",
    ]
)
webhook = os.environ.get("SLACK_WEBHOOK_URL")
if webhook:
    requests.post(webhook, json={"text": text}, timeout=30).raise_for_status()
</code></pre>
<p>Leave <code>SLACK_WEBHOOK_URL</code> unset to print only.</p>
<h2>curl and JavaScript</h2>
<pre><code class="language-bash">curl -sS -H "X-API-Key: ${WRYBORG_API_KEY}" \
  "https://api.wryborg.com/v1/recalls?allergen=peanut&amp;date_from=2026-10-23&amp;sort=-report_date&amp;limit=5"
</code></pre>
<p>Save this as <code>list-recalls.mjs</code> and run <code>node list-recalls.mjs</code> (Node 18 or later). Use <code>.mjs</code> so top-level <code>await</code> works.</p>
<pre><code class="language-javascript">const key = process.env.WRYBORG_API_KEY;
const url =
  "https://api.wryborg.com/v1/recalls?allergen=peanut&amp;date_from=2026-10-23&amp;sort=-report_date&amp;limit=5";
const response = await fetch(url, { headers: { "X-API-Key": key } });
if (!response.ok) {
  console.error(response.status, await response.text());
  process.exit(1);
}
const page = await response.json();
for (const recall of page.data) {
  console.log(recall.id, recall.reason, recall.source_url);
}
</code></pre>
<p>This API does not allow arbitrary browser origins, so do not paste a key into a public web page.</p>
<h2>Run it every six hours</h2>
<p>A cron entry such as <code>5 */6 * * *</code> is enough given the ingest cadence. Keep the seen-id file in a stable path so restarts do not replay the same alerts. Failed authentication is rate limited (30 failures per IP, and 300 across all IPs, each minute), so do not retry a bad key in a tight loop. Open <code>source_url</code> before you act, and check <code>classification</code>, <code>status</code>, <code>distribution_states</code>, and <code>reason</code> against the official notice. This script is not medical or legal advice, and it is not a food-safety guarantee.</p>
<h2>Further reading</h2>
<ul>
<li><a href="https://wryborg.com/">Wryborg</a> and <a href="https://wryborg.com/pricing/">pricing</a></li>
<li><a href="https://wryborg.com/account/signup">Create an account</a></li>
<li><a href="https://api.wryborg.com/v1/docs">Food Recall Monitor docs</a></li>
<li><a href="https://github.com/wryborg/wryborg-api-examples">Code samples on GitHub</a></li>
<li><a href="https://www.postman.com/wryborg-6585777/wryborg-apis/overview">Wryborg APIs Postman workspace</a></li>
</ul>
]]></content:encoded></item></channel></rss>