Request template
The documented query endpoint accepts POST JSON, type: filterArticles, Lucene-style filters and an API key in the Authorization header. This template uses the documented prNewswire source identifier and requests a small metadata page.
import json
import os
from urllib.request import Request, urlopen
payload = {
"type": "filterArticles",
"queryString": "source.id:prNewswire AND publishedAt:[now-1d TO *]",
"from": 0,
"size": 10,
}
request = Request(
"https://api.newsfilter.io/public/actions",
data=json.dumps(payload).encode("utf-8"),
method="POST",
headers={
"Authorization": os.environ["NEWSFILTER_API_KEY"],
"Content-Type": "application/json",
},
)
with urlopen(request, timeout=30) as response:
result = json.load(response)
for article in result.get("articles", []):
print(article["id"], article.get("publishedAt"), article.get("source", {}).get("id"))Documentation-based template, not executed against an authenticated account. Requires your own authorized key and eligible source access. It prints record IDs and source times, not article bodies.
A documentation inconsistency to avoid
The current request/response format page states a maximum size of 50. The provider’s Python example still shows 200. Use a value within the explicit format reference limit and confirm it with your account. This guide uses 10 and does not assume the larger legacy example remains accepted.
Pagination is part of the query design
Increase from by the page size for the same fixed time window. The reference caps from + size at 10,000 and recommends splitting larger exports by date. For a reproducible backfill, replace a moving now-1d window with explicit saved bounds and deduplicate overlaps by provider ID.
Interpret a response cautiously
Verify that returned source.id matches the required source and retain the original-link field. A total whose relation indicates a lower bound is not an exact corpus size. If no articles arrive, check request success, account scope, source ID, clock bounds and issuer filters before recording a coverage miss.
Before you build on it
Confirm source-specific metadata and text permissions with the provider. Do not fetch article pages to fill in empty content unless that path is explicitly authorized. Keep source IDs and provider schema versions in the adapter rather than hardcoding assumptions across your application.
Source notes
- newsfilter source IDs ↗
PR Newswire source ID prNewswire; source listing alone does not establish archive completeness.
- newsfilter request/response formats ↗
POST body, Lucene filters, article metadata, maximum size 50 and pagination ceiling.
- newsfilter Query authentication ↗
Authorization header is an API-key value, not an assumed Bearer scheme.
- newsfilter Python example ↗
Legacy example uses size 200, unlike the current format reference maximum of 50.
The Synoptic workflow
Check a Synoptic monitoring workflow
See where stream delivery fits and which PR Newswire access questions remain open.
Check a Synoptic monitoring workflow