Prompt
I keep getting stale data from public APIs
Latest observation
Nov 9, 2026
OpenAI APIWeb search: off
That usually comes from one of these:
-
HTTP caching
- The API or an intermediary cache (browser, CDN, proxy, your server) may be serving an older response.
- Check response headers like:
Cache-ControlETagLast-ModifiedAgeExpires
-
Client-side caching
- Your code, browser, or SDK may be reusing cached responses.
- Try forcing a fresh request:
Cache-Control: no-cachePragma: no-cache- add a cache-busting query param like
?t=123456
-
CDN or edge cache
- Many public APIs sit behind Cloudflare/Fastly/Akamai.
- Even if the origin has updated, the edge may still serve an old version until cache expiry or purge.
-
Eventual consistency
- Some APIs update data asynchronously, so reads lag behind writes.
- This is common with search, analytics, social, and financial data APIs.
-
Rate limiting / fallback behavior
- Under load, some APIs return cached or degraded responses instead of fresh data.
-
Your request is hitting the wrong resource
- You may be querying a summary/list endpoint that updates less frequently than a detail endpoint.
- Or a parameter may be ignored, leading you to see old/default data.
What to try:
- Inspect the raw response headers.
- Test with
curl -iand compare multiple requests. - Add a unique query string to bypass caches.
- If you control the client, disable caching explicitly.
- Check the API docs for freshness guarantees, TTLs, or “realtime” vs “delayed” endpoints.
Example:
curl -i "https://api.example.com/data?symbol=ABC&t=$(date +%s)"
If you want, paste:
- the API URL pattern,
- response headers,
- and a sample request, and I can help pinpoint where the stale data is coming from.
Brands