Timestamps API¶
The core of OpenSkip - endpoints for querying intro/outro timestamps.
Query Timestamps¶
Query timestamps with various filters. This is the main endpoint for media player integrations.
Query Parameters¶
| Parameter | Type | Description |
|---|---|---|
tvdb_id | integer | Filter by show's TVDB ID |
season | integer | Filter by season number |
episode | integer | Filter by episode number |
episode_id | integer | Filter by episode database ID |
duration_ms | integer | Filter by file duration in milliseconds |
tolerance | integer | Duration matching tolerance in ms (default: 5000) |
Recommended Query Patterns¶
Best for Plex, Sonarr, and most media managers:
Match specific file versions by duration:
Response¶
{
"items": [
{
"id": 1,
"episode_id": 1,
"duration_ms": 3550000,
"intro_start": 0.0,
"intro_end": 45.500,
"outro_start": 3420.0,
"outro_end": 3480.0,
"recap_start": null,
"recap_end": null,
"preview_start": null,
"preview_end": null,
"source": "community",
"confidence": 100,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}
],
"total": 1
}
Get Timestamp¶
Get a specific timestamp record by ID.
Example¶
Timestamp Object¶
| Field | Type | Description |
|---|---|---|
id | integer | Database ID |
episode_id | integer | Parent episode ID |
duration_ms | integer | File duration in milliseconds |
intro_start | decimal | Intro start time in seconds |
intro_end | decimal | Intro end time in seconds |
outro_start | decimal | Outro/credits start time |
outro_end | decimal | Outro/credits end time |
recap_start | decimal | "Previously on..." start time |
recap_end | decimal | Recap end time |
preview_start | decimal | "Next episode" preview start |
preview_end | decimal | Preview end time |
source | string | Data source (community, official, automated) |
confidence | integer | Confidence score (0-100) |
created_at | datetime | Record creation time |
updated_at | datetime | Last update time |
Timestamp Fields Explained¶
Intro¶
The opening credits/theme sequence. Typically at the start of the episode.
Outro¶
End credits sequence. Usually at the very end.
Recap¶
"Previously on..." segment that summarizes earlier episodes.
Preview¶
"Next time on..." or "Scenes from next episode" segment.
Duration Matching¶
Different releases of the same episode may have different durations (different cuts, framerates, etc.). Use duration_ms to find timestamps for your specific file:
# Your file is 3550000ms (59:10)
curl "https://api.openskip.io/api/v1/timestamps?tvdb_id=81189&season=1&episode=1&duration_ms=3550000"
The tolerance parameter (default 5000ms / 5 seconds) allows for minor duration differences:
Handling Multiple Results¶
When multiple timestamps exist for an episode (different versions), pick the best match:
- Duration match: Prefer timestamps matching your file's duration
- Highest confidence: Higher confidence = more verified
- Most recent: Newer entries may be more accurate
# Example: Pick best timestamp
timestamps = response["items"]
best = max(timestamps, key=lambda t: (
t["duration_ms"] == your_duration, # Exact match first
t["confidence"], # Then confidence
t["updated_at"] # Then recency
))
Integration Tips¶
Cache Responses
Timestamp data rarely changes. Cache responses for at least 24 hours to reduce API calls.
Handle Missing Data
Not all episodes have timestamps yet. Gracefully handle empty responses: