Currents Owner Interface (Portable)
Trigger
Use when a user asks to expose Currents data to end users while keeping owner credentials private.
Requirements
- Backend service with outbound internet
- Runtime env var:
CURRENTS_API_KEY
Need an API key?
If you do not have a Currents API key yet, register here:
Steps
- Accept user request at your backend only.
- Validate and allowlist request params.
- Call:
https://api.currentsapi.services/v2/latest-newshttps://api.currentsapi.services/v2/search
- Authenticate with a bearer Authorization header sourced from the environment.
- Enforce request quotas + caching.
- Return normalized response schema and error mapping.
Date filtering (UTC+0)
- Send
start_date/end_datein RFC3339/ISO-8601 format. - Convert user-local times to UTC (
Z) before requesting. - Treat returned
publishedtimestamps as UTC (+0000). - Use half-open windows (
>= start,< end) to avoid boundary duplicates.
Pitfalls
- Exposing owner key in client apps.
- No param validation.
- Missing retries/backoff on 5xx or 429.
- Using default Python urllib User-Agent can trigger Cloudflare/WAF block (
403, error1010).
Verification
- Key absent from client-side artifacts.
- Bounded page size and validated filters.
- Audit logs redact secret values.
- Backend requests send explicit browser/curl-like
User-Agent.