question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API Documentation

See original GitHub issue

List of current APIs of the node.js opendatacam app

Webcam: GET /webcamstream

Available after YOLO is started, this endpoint streams the webcam as a MJPEG stream. (streams the sequence of JPEG frames over HTTP).

The TCP connection is not closed as long as the client wants to receive new frames and the server wants to provide new frames

Only support one client at a time, if another one connect, the first HTTP connection is closed

Webcam: GET /videoresolution

Returns webcam resolution, example:

{
  "w": 1280,
  "h": 720
}

Tracker: data frame by frame: GET /tracker/sse

From the browser, you can open a SSE connection: new EventSource("/tracker/sse") . Then it works like websocket but only the server can push data. (What are SSE : Server Side Events)

Opendatacam pushes each frame this data:

{
        trackerDataForLastFrame: { someData },
        counterSummary: { someData },
        trackerSummary: { someData },
        videoResolution: { someData }, 
        appState: {
          yoloStatus: { someData },
          isListeningToYOLO: { someData },
          recordingStatus: { someData }
        }
}

TODO document data

Only support one client at a time, if another one connect, the first SSE connection is closed

Console: GET /console

Send the last 3000 characters of the console stoud.

Recording: Start recording GET /recording/start

Make Opendatacam start recording.

Recording: Stop recording GET /recording/stop

Make Opendatacam stops recording.

Recording: Get recordings history GET /recording/history

TODO implement pagination as for now it returns the last 30 recording

TODO document JSON return

Recording: Get single recording tracker data GET /recording/:id/trackerhistory

TODO document JSON return, can be a very large json

Recording: Get single recording counter data GET /recording/:id/counterhistory

TODO document JSON return

Counter: Register counting areas POST /counter/areas

TODO document post data

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
tdurandcommented, Jun 4, 2019

Added more api endpoints to make it easier to build your own layer on top of opendatacam , ideas from #79 , Also added mongodb url in the config file so people can persist data on their own remote instance

Documented them in the API docs also, here is the latest version: https://apidoc-ydewpxduvy.now.sh

0reactions
tdurandcommented, Jul 3, 2019

Ok, improved further the API and API docs for v2 release: https://opendatacam.github.io/opendatacam/apidoc/

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is API Documentation, and Why It Matters?
API documentation is a technical content deliverable, containing instructions about how to effectively use and integrate with an API.
Read more >
What Is API Documentation? [+ How to Write and Read It]
API documentation is essentially an instruction manual that explains how to use an API and its services. This manual might contain tutorials, ...
Read more >
How to Write API Documentation: Best Practices and ...
Today we will talk about how to foster positive developer experience in the API documentation. But first, we need to understand what makes ......
Read more >
What Is API Documentation? | How to Write It
API documentation is technical content that documents the API. It includes instructions on how to effectively use and integrate the API.
Read more >
Generating API documentation
Documentation is an important part of any collection or API. Good documentation helps the people who use your collection to understand what ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found