Backfill a season
Import a bounded competition history with checkpoints and repeatable updates.
Define the import
Choose one competition and an available season in the coverage directory. Record their identifiers and the detail your analysis requires. An event-level results table needs fewer requests than a store of every box score. Coverage directory
Commit one page at a time
- Request a page of events under the same competition and season filters.
- Upsert the events using their complete IDs.
- Record the page's
next_offsetwith those filters after the writes succeed. - Request the next page with that offset. Stop when
next_offsetis null.
If a process stops between writing the events and saving its offset, it can process that page again. The ID-based write updates the existing rows. Pagination
Queue detailed records
Keep a separate work queue for box scores and plays. Store the event ID and the requested detail on each job. This lets a partial failure in a large play list recover independently of the event index. Pace the queue against the rate limit and budget the detail requests separately. Rate limits · Credits
Reconcile the result
Compare the distinct event IDs in the import with the source pages you processed. Keep postponed and rescheduled events in the same records when their IDs match. Refresh recent or corrected games without rebuilding the whole season.
curl --request GET "https://api.precisesports.io/v1/events?competition=nba&status=in_progress" \
--header "Authorization: Bearer $PRECISEDATA_KEY"