Skip to content

Commit

Permalink
Add API Doc (#10)
Browse files Browse the repository at this point in the history
* Add API Doc

* Update API.md

Co-authored-by: Christoph <[email protected]>

* Update README.md

Co-authored-by: Christoph <[email protected]>

* Update API.md

Co-authored-by: Christoph <[email protected]>

Co-authored-by: Jonas <[email protected]>
Co-authored-by: Christoph <[email protected]>
  • Loading branch information
3 people authored Apr 5, 2021
1 parent 0fa0fa7 commit ae68660
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# ZomStream API
Zomstream provides a RESTful API that can be used to query for streams.
As of API version 0.2, there are two API endpoints:
## List of active streams
You can query for a list of active streams, by sending a GET request to
`localhost:8080/api/streams/`
Here's an example query and the expected result:

`$ curl http://localhost:8080/api/v0.2/streams/`
Response example:
```json
{
"streams":
[
{"app":"live","name":"foo"},
{"app":"live","name":"bar"}
]
}

```
i.e. There are two active streams in the `live` app, namely foo and bar. More information about the streams can be queried as follows.

## Query Stream information
If you know the app and name of the stream you want to query, you can request more information,with a query like this:
`$ curl http://localhost:8080/api/v0.2/streams/foo/`
Response example:
```json
{
"streams":{
"app":"live",
"name":"foo",
"urls":
[
{"type":"http_flv","url":"https://localhost:8080/flv?app=live&stream=foo"},
{"type":"rtmp","url":"rtmp://localhost/live/foo"}
]
}
}

```
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ this is a simple PSK based authentication module to provide authentication for s

### frontend
this components provides the visible website containing an overview of the running streams, a REST API, rtmp links for external players and a web based video player to watch the livestreams.
There is more information about the API in [API.md](API.md)

## How to use this
We tested this with OBS and ffmpeg but any steaming source supporting rtmp should work just fine.
Expand Down

0 comments on commit ae68660

Please sign in to comment.