# Data sources All data comes from the public HN Search API by Algolia (https://hn.algolia.com/api/v1/). It needs no API key. - **Endpoints:** `/search` for relevance-ranked results and the trending view, `/search_by_date` for newest-first results and all time-based counts. - **Server-side only:** the browser never calls Algolia. The Rails server makes every request, so caching, timeouts and request limits live in one place. - **Caching:** responses are cached for 10 minutes. Counts for periods that ended more than two days ago cannot change, so they are cached for a week. - **Request budget:** an uncached search makes at most 9 small requests, sharing a pool of 8 threads. Timeouts are 4s to connect and 6s to read, with one retry only when the connection never opened. - **Failures:** timeouts, non-2xx responses and malformed JSON show an error state with a retry. Failed responses are never cached and nothing falls back to made-up data. - **Links:** every story and comment links to its thread on news.ycombinator.com.