Stream a run's progress (SSE)
curl --request GET \
--url https://api.mireye.com/v1/runs/{run_id}/eventsimport requests
url = "https://api.mireye.com/v1/runs/{run_id}/events"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.mireye.com/v1/runs/{run_id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mireye.com/v1/runs/{run_id}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mireye.com/v1/runs/{run_id}/events"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mireye.com/v1/runs/{run_id}/events")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mireye.com/v1/runs/{run_id}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Runs
GET /v1/runs/{run_id}/events
Watch a batch run’s progress as Server-Sent Events instead of polling.
GET
/
v1
/
runs
/
{run_id}
/
events
Stream a run's progress (SSE)
curl --request GET \
--url https://api.mireye.com/v1/runs/{run_id}/eventsimport requests
url = "https://api.mireye.com/v1/runs/{run_id}/events"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.mireye.com/v1/runs/{run_id}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mireye.com/v1/runs/{run_id}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mireye.com/v1/runs/{run_id}/events"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mireye.com/v1/runs/{run_id}/events")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mireye.com/v1/runs/{run_id}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Streams a batch run’s progress as Server-Sent Events. It is a convenience over
polling
What the frames carry:
GET /v1/runs/{run_id}.
- It sends a
statusframe on every state or progress change. - Then one terminal
finalframe carries the complete run body.
The poll endpoint remains the source of truth. If the stream drops, fall back
to polling. Do not treat a dropped connection as a failed run.
curl -N -s "https://api.mireye.com/v1/runs/$RUN_ID/events" \
-H "Authorization: Bearer $MIREYE_API_TOKEN" \
-H 'accept: text/event-stream'
event: status
data: {"status": "queued", "progress": {"done": 0, "total": 2}}
event: status
data: {"status": "running", "progress": {"done": 1, "total": 2}}
event: final
data: {"run_id": "...", "status": "done", "result": {...}, ...}
- A
statusframe hasstatusandprogressonly. progressis{done, total}, counted in locations.- On a
statusframe,statusisqueuedorrunning. - On the
finalframe,statusisdoneorfailed. - Only the
finalframe carriesresult. There are no partial results.