Efficient tools to build your streaming infrastructure
Nimble Streamer Native API Reference
This Nimble Streamer Native Built-In API Reference page provides information about the set of API methods available for a Nimble Streamer instance. The APIs can be used for obtaining real-time status of the instance and controlling some of its parameters and features. APIs works directly with the instance without any delays and can be accessed using HTTP calls with either GET, POST, or DELETE requests. The API can provide information such as server basic status, live outgoing streams status, RTMP re-publishing status, MPEG-TS incoming streams status, Icecast stream information, server playout current status, and many more.
Nimble Streamer HTTP API
Nimble Streamer accepts HTTP calls to control its behavior and to get some stats and other data. Each call is a GET, POST or DELETE request via HTTP. As a response you get JSON structure with required data or raw data in case of MP4 archive.
All
Expand all
/
Collapse all
Click on sections below to see respective API calls.
API setup
Starting point: enable API access
API management
Network
To make Nimble Streamer responding to API requests, the API settings must be set up in /etc/nimble/nimble.conf configuration file. You may check config description to get details about other parameters. All parameters mentioned below are excluded from config by default.
management_listen_interfaces
This parameter specifies which IP addresses will be used for accepting API requests. If it's not set, the API requests are not accepted.
Examples: management_listen_interfaces = * API setup- all available interfaces are used management_listen_interfaces = 127.0.0.1, 192.168.0.1
management_port
This one specifies which port is used to listen to API requests. If it's missing, the 8082 port is used.
Example: management_port = 8086
management_token
This parameters specifies the token (i.e. password) which is used for authorizing API requests. See Making authorized requests section below for details. If this parameter is missing, there will be no authorization made and anyone will be able to get information.
Example: management_token = mypassword
Option: Making authorized requests
API management
Network
This is an optional step for the cases when you use management_token parameter for authorizing requests. To make authorized requests you need to make MD5 hash based on the specified token. Please refer to this code sample to see how you can generate this hash.
This POST method forces Nimble Streamer to reload config from WMSPanel.
Request URL: /manage/sync_panel_settings Request example: curl -X POST http://127.0.0.1:8083/manage/sync_panel_settings
Reload Nimble Streamer config
Config
Reload
This POST method allows reloading Nimble Streamer config without restarting server. By default, only rules.conf is reloaded. If you want to reload drm.conf to apply new DRM settings on-the-fly, add drm=true parameter as shown below.
Request URL: /manage/reload_config[?drm=true] Request example: curl -X POST http://127.0.0.1:8083/manage/reload_config
Reload SSL certificates
SSL
Reload
This POST method allows reloading SSL certificates.
Request URL: /manage/reload_ssl_certificates Request example: curl -X POST http://127.0.0.1:8082/manage/reload_ssl_certificates
Streams and sessions
Get live outgoing streams status
Status
This method allows getting current status of outgoing streams for all supported protocols. Note: /manage/rtmp_status is considered deprecated.
This method allows getting the list of all active end-user sessions. So whoever is watching or listening streams, their sessions will be shown. This allows collecting and analysing current viewers and gather basic stats. You can also disconnect any of these sessions using /manage/sessions/delete method.
This method allows deleting any specific session or sessions based on the IDs from /manage/sessions method. When HLS or MPEG-DASH session is deleted, a client gets 403 HTTP response. For other protocols, (MPEG-TS/Icecast/RTMP/RTSP/SRT) the client is just disconnected.
This GET method allows getting current status of RTMP streams re-publishing.
Request URL: /manage/rtmp/republish/stats Response parameters: All are nested under "stats" node.
rule_id - unique RTMP republish rule ID for further usage.
state - is the stream connected or not.
session_duration - duration of session.
bandwidth - current bandwidth.
bytes_recv - quantity of bytes received.
bytes_sent - quantity of bytes sent.
owner - which side has set this rule: 0 is for WMSPanel, 1 is for Nimble API.
retry_count - number of retries of this re-publisher if there where session breaks.
src_app - source application name.
src_stream - source stream name. If not specified, then all streams from the source application are republished.
dest_addr - destination URL or IP address where the application stream/streams are published.
dest_port - destination port.
dest_app - name of destination streaming application.
dest_stream - destination stream name.
Another basic field is "status" to show current status of re-publisher. Request example: curl -vvv http://127.0.0.1:8082/manage/rtmp/republish/stats Response example:
This GET method allows getting list of RTMP streams re-publishing rules which were created via Nimble API only. For full list please refer to WMSPanel control API reference.
Request URL: /manage/rtmp/republish Response parameters: All are nested under "rules" node, with each rule having its nested node. Another node is "status" which indicates the status of request.
id - unique RTMP republish rule ID for further usage.
src_app - source application name.
src_stream - source stream name. If not specified, then all streams from the source application are republished.
dest_addr - destination URL or IP address where the application stream/streams are published.
dest_port - destination port.
dest_app - name of destination streaming application.
dest_stream - destination stream name.
dest_app_params - special parameters for destination streaming application.
dest_stream_params - special parameters for destination stream.
auth_schema - authentication schema for destination. Can be "NONE", "NIMBLE", "AKAMAI", "LIMELIGHT" or "PERISCOPE".
dest_login - login for authentication on destination. Relevant for "NIMBLE", "AKAMAI" and "LIMELIGHT" authentication schemas.
dest_password - password for authentication on destination. Relevant for "NIMBLE", "AKAMAI" and "LIMELIGHT" authentication schemas.
keep_src_stream_params - indicates source stream parameters handling mode. Should be true to keep source stream parameters in destination stream. Default value is false.
ssl - indicates SSL usage. If not specified, then it's automatically set to false. If set to true, then correct SSL port should be specified (usually 443). Relevant for "NONE" and "NIMBLE" authentication schemas.
This GET method allows getting certain RTMP stream re-publishing rule.
Request URL: /manage/rtmp/republish/<id> Request parameters: All are nested under "rules" node, with each rule having its nested node. Another node is "status" which indicates the status of request.
src_app- source application name.
src_stream - source stream name. If not specified, then all streams from the source application are republished.
dest_addr - destination URL or IP address where the application stream/streams are published.
dest_port - destination port.
dest_app - name of destination streaming application.
dest_stream - destination stream name.
dest_app_params - special parameters for destination streaming application.
dest_stream_params - special parameters for destination stream.
auth_schema - authentication schema for destination. Can be "NONE", "NIMBLE", "AKAMAI", "LIMELIGHT" or "PERISCOPE".
dest_login - login for authentication on destination. Relevant for "NIMBLE", "AKAMAI" and "LIMELIGHT" authentication schemas.
dest_password - password for authentication on destination. Relevant for "NIMBLE", "AKAMAI" and "LIMELIGHT" authentication schemas.
keep_src_stream_params - indicates source stream parameters handling mode. Should be true to keep source stream parameters in destination stream. Default value is false.
ssl - indicates SSL usage. If not specified, then it's automatically set to false. If set to true, then correct SSL port should be specified (usually 443). Relevant for "NONE" and "NIMBLE" authentication schemas.
This POST method allows creating a new RTMP re-publishing rule. Notice that re-publishing setting defined by this API call are not persistent and they are reset after Nimble Streamer re-load. If you'd like to keep them, you should use WMSPanel control API instead.
src_stream - source stream name. If not specified, then all streams from the source application are republished.
dest_addr - destination URL or IP address where the application stream/streams are published.
dest_port - destination port.
dest_app - name of destination streaming application.
dest_stream - destination stream name.
dest_app_params - special parameters for destination streaming application.
dest_stream_params - special parameters for destination stream.
auth_schema - authentication schema for destination. Can be "NONE", "NIMBLE", "AKAMAI", "LIMELIGHT" or "PERISCOPE".
dest_login - login for authentication on destination. Relevant for "NIMBLE", "AKAMAI" and "LIMELIGHT" authentication schemas.
dest_password - password for authentication on destination. Relevant for "NIMBLE", "AKAMAI" and "LIMELIGHT" authentication schemas.
keep_src_stream_params - indicates source stream parameters handling mode. Should be true to keep source stream parameters in destination stream. Default value is false.
ssl - indicates SSL usage. If not specified, then it's automatically set to false. If set to true, then correct SSL port should be specified (usually 443). Relevant for "NONE" and "NIMBLE" authentication schemas.
Response parameters will have same set of fields under "rules" node, plus "id" field to indicate what ID was assigned to this new rule. It'll also have "status" field to indicate the result of the call.
This DELETE method allows deleting specified setting of RTMP stream re-publishing. Notice that re-publishing setting defined by this API call are not persistent and they are reset after Nimble Streamer re-load. If you'd like to keep them, you should use WMSPanel control API instead.
Request URL: /manage/rtmp/republish/<id> Response parameters: Response has "status" filed with either "Ok" or "NotFound".
These methods allow getting current sender and receiver stats for RIST streams. In order to use these API calls, you need to add "rist-stats-interval" parameter into RIST output and input respectively, setting interval in seconds.
Request URL: /manage/rist_sender_stats /manage/rist_receiver_stats Response parameters: Returned fields are defined by RIST protocol spec.
application/stream - show information only for specified stream (e.g. /manage/dvr_status/live/stream will only return information for stream "live/steam")
Response parameters:
size - size of all segments of archive
bandwidth - size devided by duration
resolution - stream resolution
acodec - audio codec
vcodec - video codec
path - archive path
space_available - free space available for archive
periods - a number of sessions in archive (e.g. how many times it was pulled/pushed)
stream - stream name
duration - total duration of archive
timeline - set of each DVR period's start/end epoch timestamps, duration and sequence number
start - get content recorded after the specified Unix epoch timestamp, e.g. from=1507732548
end - get only content recorded prior to the specified Unix epoch timestamp, e.g. to=1507732600
Request example: curl -o archive.mp4 -v "http://127.0.0.1:8082/manage/dvr/export_mp4/live/stream?start=1542708934&end=1542712534" Response: response body carries the entire result MP4 file.
Export archive subtitles to .srt file
DVR
WebVTT
Subtitles
This method allows getting recorded WebVTT subtitles as .srt file from DVR archive for the specified stream. You can use it with MP4 file exported from the same DVR archive.
target_depth - preserve last N minutes of recording
from - clean only content recorded after the specified Unix epoch timestamp, e.g. from=1507732548
to (older_than) - clean only content recorded prior to the specified Unix epoch timestamp, e.g. to=1507732600
Response parameters:
status - shows the result
Request example: curl -X POST http://127.0.0.1:8082/manage/dvr/cleanup_archive/application/stream Response example: {"status": "Ok"} or {"status": "Not found"}
Advertizer
Insert SCTE-35 Out marker
Advertizer
SCTE-35
This POST method triggers insertion for SCTE35 Out marker into /<app>/<stream> if that stream is configured with "time_sync":"scte35" in Nimble Advertizer. It also allows setting the "duration" parameter to set the time in seconds for returning from ads. The "unique_program_id" parameter value provides a unique identification for a viewing event within the service. Read SCTE-35 marker insertion article and Nimble Advertizer spec for more details. Notice that this feature requires Addenda license to operate. Request URL: /manage/advertizer/scte35_out/<app>/<stream>[?duration=<time>][&unique_program_id=<programid>] Request examples: curl -vX POST http://127.0.0.1:8083/manage/advertizer/scte35_out/live/stream1 curl -vX POST http://127.0.0.1:8083/manage/advertizer/scte35_out/live/stream2?duration=10 Response example: {"status": "Ok"}
Insert SCTE-35 In marker
Advertizer
SCTE-35
This POST method triggers insertion for SCTE35 In marker into /<app>/<stream> if that stream is configured with "time_sync":"scte35" in Nimble Advertizer. It also allows setting the "unique_program_id" parameter value to provide a unique identification for a viewing event within the service. Read SCTE-35 marker insertion article and Nimble Advertizer spec for more details. Request URL: /manage/advertizer/scte35_in/<app>/<stream>[?unique_program_id=<programid>] Request example: curl -vX POST http://127.0.0.1:8083/manage/advertizer/scte35_in/live/stream Response example: {"status": "Ok"}
Icecast
Get Icecast stream information
Icecast
This API method allows getting information about existing Icecast stream. Response parameters are taken from Icecast metadata settings, most of which can be set up via WMSPanel UI.
This POST method injects Icecast metadata into /<app>/<stream> RTMP stream. Read Manual ingest of Icecast metadata into RTMP via API article for more details. Request URL: /manage/icecast_metadata/<app>/<stream> Request example: curl -vvv http://127.0.0.1:8083/manage/icecast_metadata/live/radio -d "{\"streamtitle\":\"title\", \"streamurl\":\"url\"}" Response example: {"status": "Ok"}
Server playlist
Get server playlist current status
Server playlist
This method allows getting the status of output streams generated by Server Playout feature set.
This method sends to Nimble Streamer a list of blocked sessions. It's a POST request. This is part of publish control framework for RTMP and RTSP published streams.
This GET method allows getting a cache key for any item in Nimble cache for further removal. This relates to re-streaming use cases (including remote VOD).
This POST method deletes all items from Nimble cache by a cache key. This relates to re-streaming use cases (including remote VOD). For HLS items it deletes a playlist, chunk lists and chunks related to specified file.
WMSPanel web panel allows controlling Nimble Streamer and getting aggregated server statistics via HTTP API. The control API methods reflect all major control features accessible via web UI so this brings ability for streaming automation. Please check WMSPanel API reference for more details.