Skip to main content

EyesOnItAPI

eyesonit-typescript-sdk


eyesonit-typescript-sdk / EyesOnItAPI

Class: EyesOnItAPI

Client for the EyesOnIt REST API.

This class wraps the HTTP endpoints exposed by EyesOnIt and returns typed response objects for each operation.

Constructors​

Constructor​

new EyesOnItAPI(apiBasePath, restHandler?, customLogger?): EyesOnItAPI

Creates an API client instance.

Parameters​

apiBasePath​

string

Base URL for the EyesOnIt API, for example http://localhost:8000.

restHandler?​

IEOIRESTHandler

Optional custom REST handler. If omitted, Axios is used.

customLogger?​

any

Optional logger implementation. Defaults to an internal logger.

Returns​

EyesOnItAPI

Methods​

Method Groups​

Image and Video​

Face Recognition​

Status​

Config​

Image and Video​

processImage()​

processImage(inputs): Promise<EOIProcessImageResponse>

Processes a single image with the detection configuration defined in the request.

Parameters​

inputs​

EOIProcessImageInputs

Image and detection configuration payload.

Returns​

Promise<EOIProcessImageResponse>

A typed response containing success state, message, and image detections.

Remarks​

Endpoint: POST /process_image


addStream()​

addStream(inputs): Promise<EOIAddStreamResponse>

Registers a stream for monitoring and detection.

Parameters​

inputs​

EOIAddStreamInputs

Stream URL and monitoring configuration.

Returns​

Promise<EOIAddStreamResponse>

A typed response containing stream registration results.

Remarks​

Endpoint: POST /add_stream


processVideo()​

processVideo(inputs): Promise<EOIProcessVideoResponse>

Submits a video for asynchronous processing with the supplied detection settings.

Parameters​

inputs​

EOIProcessVideoInputs

Video metadata and detection configuration.

Returns​

Promise<EOIProcessVideoResponse>

A typed response containing processing status details.

Remarks​

Endpoint: POST /process_video


removeStream()​

removeStream(streamUrl): Promise<EOIRemoveStreamResponse>

Removes a previously registered stream.

Parameters​

streamUrl​

string

RTSP stream URL to remove.

Returns​

Promise<EOIRemoveStreamResponse>

A typed response indicating whether the stream was removed.

Remarks​

Endpoint: POST /remove_stream


getVideoFrame()​

getVideoFrame(streamUrl): Promise<EOIGetVideoFrameResponse>

Retrieves the latest frame for a stream.

Parameters​

streamUrl​

string

RTSP stream URL to query.

Returns​

Promise<EOIGetVideoFrameResponse>

A typed response that includes a frame image payload.

Remarks​

Endpoint: POST /get_video_frame


Search​

searchArchive()​

searchArchive(inputs): Promise<EOISearchResponse>

Executes a search over archived detections and recordings.

Parameters​

inputs​

EOIArchiveSearchInputs

Archive search criteria and filters.

Returns​

Promise<EOISearchResponse>

A typed response containing matching results.

Remarks​

Endpoint: POST /archive_search


searchLive()​

searchLive(inputs): Promise<EOILiveSearchResponse>

Starts a live search task against active streams.

Parameters​

inputs​

EOILiveSearchInputs

Live search configuration and criteria.

Returns​

Promise<EOILiveSearchResponse>

A typed response containing the live search identifier and status.

Remarks​

Endpoint: POST /live_search


pauseLiveSearch()​

pauseLiveSearch(inputs): Promise<EOIResponse>

Pauses one live search task or all live search tasks.

Parameters​

inputs​

EOIUpdateLiveSearchInputs

Search identifier payload. Use -1 to target all searches.

Returns​

Promise<EOIResponse>

Base API response indicating pause status.

Remarks​

Endpoint: POST /pause_live_search


resumeLiveSearch()​

resumeLiveSearch(inputs): Promise<EOIResponse>

Resumes one paused live search task or all paused live search tasks.

Parameters​

inputs​

EOIUpdateLiveSearchInputs

Search identifier payload. Use -1 to target all searches.

Returns​

Promise<EOIResponse>

Base API response indicating resume status.

Remarks​

Endpoint: POST /resume_live_search


cancelLiveSearch()​

cancelLiveSearch(inputs): Promise<EOIResponse>

Cancels one live search task or all live search tasks.

Parameters​

inputs​

EOIUpdateLiveSearchInputs

Search identifier payload. Use -1 to target all searches.

Returns​

Promise<EOIResponse>

Base API response indicating cancel status.

Remarks​

Endpoint: POST /cancel_live_search


Face Recognition​

getFacerecGroups()​

getFacerecGroups(): Promise<EOIGetFacerecGroupsResponse>

Lists face recognition groups.

Returns​

Promise<EOIGetFacerecGroupsResponse>

A typed response containing all configured face recognition groups.

Remarks​

Endpoint: GET /facerec_groups


addFacerecGroup()​

addFacerecGroup(inputs): Promise<EOIBaseOutputs>

Creates a face recognition group.

Parameters​

inputs​

EOIAddFacerecGroupInputs

Group identifier, display name, and description.

Returns​

Promise<EOIBaseOutputs>

Base typed response indicating creation status.

Remarks​

Endpoint: POST /facerec_add_group


removeFacerecGroup()​

removeFacerecGroup(group_id): Promise<EOIRemoveFacerecGroupResponse>

Deletes a face recognition group.

Parameters​

group_id​

string

Group identifier to remove.

Returns​

Promise<EOIRemoveFacerecGroupResponse>

A typed response indicating whether the group was removed.

Remarks​

Endpoint: POST /facerec_remove_group


addFacerecPerson()​

addFacerecPerson(inputs): Promise<EOIBaseOutputs>

Creates a face recognition person profile and attaches images/groups.

Parameters​

inputs​

EOIAddFacerecPersonInputs

Person identifier, display name, groups, and images.

Returns​

Promise<EOIBaseOutputs>

Base typed response indicating creation status.

Remarks​

Endpoint: POST /facerec_add_person


addFacerecPeople()​

addFacerecPeople(inputs): Promise<EOIBaseOutputs>

Bulk imports face recognition people from a file.

Parameters​

inputs​

EOIAddFacerecPeopleInputs

File path payload for bulk person import.

Returns​

Promise<EOIBaseOutputs>

Base typed response indicating import status.

Remarks​

Endpoint: POST /facerec_add_people


removeFacerecPerson()​

removeFacerecPerson(person_id): Promise<EOIBaseOutputs>

Deletes a face recognition person profile.

Parameters​

person_id​

string

Person identifier to remove.

Returns​

Promise<EOIBaseOutputs>

Base typed response indicating whether the person was removed.

Remarks​

Endpoint: POST /facerec_remove_person


searchFacerecGroupNames()​

searchFacerecGroupNames(search): Promise<EOISearchFacerecNamesResponse>

Searches face recognition group names by text.

Parameters​

search​

string

Search text used to match group names.

Returns​

Promise<EOISearchFacerecNamesResponse>

A typed response containing matching group names.

Remarks​

Endpoint: POST /facerec_search_group_names


searchFacerecPeopleNames()​

searchFacerecPeopleNames(search): Promise<EOISearchFacerecNamesResponse>

Searches face recognition person names by text.

Parameters​

search​

string

Search text used to match person names.

Returns​

Promise<EOISearchFacerecNamesResponse>

A typed response containing matching person names.

Remarks​

Endpoint: POST /facerec_search_people_names


getFacerecPersonDetails()​

getFacerecPersonDetails(person_id): Promise<EOIFacerecPersonDetailsResponse>

Returns details for one face recognition person profile.

Parameters​

person_id​

string

Person identifier to query.

Returns​

Promise<EOIFacerecPersonDetailsResponse>

A typed response containing person profile details.

Remarks​

Endpoint: POST /facerec_person_details

Status​

health()​

health(): Promise<EOIHealthResponse>

Returns server health metrics.

Returns​

Promise<EOIHealthResponse>

A typed response containing GPU, system, and raw health payload data.

Remarks​

Endpoint: GET /health


monitorStream()​

monitorStream(inputs): Promise<EOIMonitorStreamResponse>

Starts monitoring a stream that has already been added.

Parameters​

inputs​

EOIMonitorStreamInputs

Stream identifier and optional duration.

Returns​

Promise<EOIMonitorStreamResponse>

A typed response containing monitor start status.

Remarks​

Endpoint: POST /monitor_stream


stopMonitoringStream()​

stopMonitoringStream(streamUrl): Promise<EOIStopMonitoringStreamResponse>

Stops active monitoring for a stream.

Parameters​

streamUrl​

string

RTSP stream URL to stop monitoring.

Returns​

Promise<EOIStopMonitoringStreamResponse>

A typed response indicating whether monitoring stopped.

Remarks​

Endpoint: POST /stop_monitoring


getAllStreamsInfo()​

getAllStreamsInfo(): Promise<EOIGetAllStreamsInfoResponse>

Returns summary information for all registered streams.

Returns​

Promise<EOIGetAllStreamsInfoResponse>

A typed response with stream information records.

Remarks​

Endpoint: GET /get_all_streams_info


getStreamDetails()​

getStreamDetails(streamUrl): Promise<EOIGetStreamDetailsResponse>

Returns detailed status and configuration for a single stream.

Parameters​

streamUrl​

string

RTSP stream URL to query.

Returns​

Promise<EOIGetStreamDetailsResponse>

A typed response with detailed stream information.

Remarks​

Endpoint: POST /get_stream_details


getLastDetectionInfo()​

getLastDetectionInfo(streamUrl): Promise<EOIGetLastDetectionInfoResponse>

Returns the most recent detection information for a stream.

Parameters​

streamUrl​

string

RTSP stream URL to query.

Returns​

Promise<EOIGetLastDetectionInfoResponse>

A typed response with the latest detection payload.

Remarks​

Endpoint: POST /get_last_detection_info


Config​

updateConfig()​

updateConfig(inputs): Promise<EOIUpdateConfigResponse>

Updates runtime configuration on the EyesOnIt server.

Parameters​

inputs​

EOIUpdateConfigInputs

Typed wrapper for the configuration payload accepted by the /update_config endpoint.

Returns​

Promise<EOIUpdateConfigResponse>

A typed response containing update status details.

Remarks​

Endpoint: POST /update_config