Recommend section of a track
GET /v0/tracks/:trackId/highlights
Powered by our 2 billion daily streams on YouTube, the highlights endpoint uses machine learning to recommend the best time section.
You can use highlights to start playing the track from the right millisecond, or recommend the right part of the track for shorter content.
The highlights endpoint provides start and stop timestamps in milliseconds. The default duration is 30 seconds.
The endpoint accepts up to 5 different durations per request where each duration must be at least 5 seconds and at most 60 seconds.
Path Parameters
- trackId string required
Track id
Query Parameters
- duration int32[]
The highlight duration in seconds
- 200
- 400
- 401
- 404
- 429
List of highlighted sections for the track. The times are given in milliseconds. If there is no available highlight, a fallback to the first section of the track is returned.
- application/json
- Schema
- Example (from schema)
- Example
Schema
highlights object[] required
Array [from int32 requiredto int32 requiredduration int32 required]
{
"highlights": [
{
"from": 0,
"to": 0,
"duration": 0
}
]
}
{
"highlights": [
{
"from": 9000,
"to": 39000,
"duration": 30
}
]
}
Bad request.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- message string required
Human readable message
errors object[]
Array [key string requiredError key
messages string[] requiredError messages
]
{
"message": "string",
"errors": [
{
"key": "string",
"messages": [
"string"
]
}
]
}
{
"message": "Bad request"
}
Unauthorized. Most likely your access token has expired.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- message string required
Human readable message
errors object[]
Array [key string requiredError key
messages string[] requiredError messages
]
{
"message": "string",
"errors": [
{
"key": "string",
"messages": [
"string"
]
}
]
}
{
"message": "Invalid credentials"
}
Track was not found.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- message string required
Human readable message
errors object[]
Array [key string requiredError key
messages string[] requiredError messages
]
{
"message": "string",
"errors": [
{
"key": "string",
"messages": [
"string"
]
}
]
}
{
"message": "Track was not found"
}
Rate limit exceeded.
- application/json
- Schema
- Example (from schema)
- Example
Schema
- message string required
Human readable message
errors object[]
Array [key string requiredError key
messages string[] requiredError messages
]
{
"message": "string",
"errors": [
{
"key": "string",
"messages": [
"string"
]
}
]
}
{
"message": "Rate limit exceeded"
}