Amazon Kinesis Video Streams
Developer Guide


Returns a list of Fragment objects from the specified stream and timestamp range within the archived data.

Listing fragments is eventually consistent. This means that even if the producer receives an acknowledgment that a fragment is persisted, the result might not be returned immediately from a request to ListFragments. However, results are typically available in less than one second.


You must first call the GetDataEndpoint API to get an endpoint. Then send the ListFragments requests to this endpoint using the --endpoint-url parameter.

Request Syntax

POST /listFragments HTTP/1.1 Content-type: application/json { "FragmentSelector": { "FragmentSelectorType": "string", "TimestampRange": { "EndTimestamp": number, "StartTimestamp": number } }, "MaxResults": number, "NextToken": "string", "StreamName": "string" }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.


Describes the timestamp range and timestamp origin for the range of fragments to return.

Type: FragmentSelector object

Required: No


The total number of fragments to return. If the total number of fragments available is more than the value specified in max-results, then a ListFragments:NextToken is provided in the output that you can use to resume pagination.

Type: Long

Valid Range: Minimum value of 1. Maximum value of 1000.

Required: No


A token to specify where to start paginating. This is the ListFragments:NextToken from a previously truncated response.

Type: String

Length Constraints: Minimum length of 1.

Required: No


The name of the stream from which to retrieve a fragment list.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: [a-zA-Z0-9_.-]+

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "Fragments": [ { "FragmentLengthInMilliseconds": number, "FragmentNumber": "string", "FragmentSizeInBytes": number, "ProducerTimestamp": number, "ServerTimestamp": number } ], "NextToken": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


A list of archived Fragment objects from the stream that meet the selector criteria. Results are in no specific order, even across pages.

Type: Array of Fragment objects


If the returned list is truncated, the operation returns this token to use to retrieve the next page of results. This value is null when there are no more results to return.

Type: String

Length Constraints: Minimum length of 1.


For information about the errors that are common to all actions, see Common Errors.


Kinesis Video Streams has throttled the request because you have exceeded the limit of allowed client calls. Try making the call later.

HTTP Status Code: 400


A specified parameter exceeds its restrictions, is not supported, or can't be used.

HTTP Status Code: 400


Status Code: 403, The caller is not authorized to perform an operation on the given stream, or the token has expired.

HTTP Status Code: 401


GetMedia throws this error when Kinesis Video Streams can't find the stream that you specified.

GetHLSStreamingSessionURL throws this error if a session with a PlaybackMode of ON_DEMAND is requested for a stream that has no fragments within the requested time range, or if a session with a PlaybackMode of LIVE is requested for a stream that has no fragments within the last 30 seconds.

HTTP Status Code: 404

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: