Events
Base URL
https://api.example.com
GET
/api/v1/events/stream
Stream Events
Server-Sent Events stream for real-time job monitoring.
Connect to this endpoint to receive live job events for your client account. Events are streamed as they happen - no polling required.
Authentication: Pass your credentials as a query parameter:
GET /api/v1/events/stream?token=client_id:api_key:api_secretEvent Types:
connected: Sent when connection is establishedjob.queued: Job submitted and queued for processingjob.started: Worker picked up the jobjob.completed: Job finished successfullyjob.failed: Job encountered an errorheartbeat: Keep-alive signal (every 30 seconds)
Event Format (SSE):
event: job.completed
data: {"job_id": "abc-123", "processing_time": 45.2, "results_count": 15}
JavaScript Example:
const token = 'cli_xxx:sk_xxx:secret_xxx';
const eventSource = new EventSource(
`https://spideriq.ai/api/v1/events/stream?token=${token}`
);
eventSource.addEventListener('job.completed', (e) => {
const data = JSON.parse(e.data);
console.log('Job completed:', data.job_id);
});Returns: SSE stream of job events
Parameters
token
any
query
Auth token (client_id:api_key:api_secret)
Responses
200Successful Response422Validation Error
curl -X GET 'https://api.example.com/api/v1/events/stream' \
-H 'Authorization: Bearer '
import httpx
resp = httpx.get(
"https://api.example.com/api/v1/events/stream",
headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/events/stream", {
method: "GET",
headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.example.com/api/v1/events/stream", nil)
req.Header.Set("Authorization", "Bearer ")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}
GET
/api/v1/events/status
Get Event Status
Get event service status.
Returns: Event service health and active subscription count
Responses
200Successful Response
curl -X GET 'https://api.example.com/api/v1/events/status' \
-H 'Authorization: Bearer '
import httpx
resp = httpx.get(
"https://api.example.com/api/v1/events/status",
headers={"Authorization": "Bearer "},
)
resp.raise_for_status()
print(resp.json())
const resp = await fetch("https://api.example.com/api/v1/events/status", {
method: "GET",
headers: { "Authorization": "Bearer " }
});
const data = await resp.json();
console.log(data);
package main
import (
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.example.com/api/v1/events/status", nil)
req.Header.Set("Authorization", "Bearer ")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
}
Ask AI