Subscribe to SSE publications
curl --request GET \
--url https://dev.backend.scan.biya.io/api/v1/streamimport requests
url = "https://dev.backend.scan.biya.io/api/v1/stream"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://dev.backend.scan.biya.io/api/v1/stream', 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://dev.backend.scan.biya.io/api/v1/stream",
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://dev.backend.scan.biya.io/api/v1/stream"
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://dev.backend.scan.biya.io/api/v1/stream")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.backend.scan.biya.io/api/v1/stream")
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"id: 12\nevent: l1Action\ndata: {\"explorerId\":\"0x...\"}\n"{
"error": "block not found"
}{
"error": "block not found"
}Realtime
Subscribe to SSE publications
Server-sent events. Event id is publicationSeq. Event names are
block or l1Action. Query after overrides Last-Event-ID.
Error events must not advance the business cursor. Empty blocks do not emit events.
GET
/
api
/
v1
/
stream
Subscribe to SSE publications
curl --request GET \
--url https://dev.backend.scan.biya.io/api/v1/streamimport requests
url = "https://dev.backend.scan.biya.io/api/v1/stream"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://dev.backend.scan.biya.io/api/v1/stream', 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://dev.backend.scan.biya.io/api/v1/stream",
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://dev.backend.scan.biya.io/api/v1/stream"
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://dev.backend.scan.biya.io/api/v1/stream")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev.backend.scan.biya.io/api/v1/stream")
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"id: 12\nevent: l1Action\ndata: {\"explorerId\":\"0x...\"}\n"{
"error": "block not found"
}{
"error": "block not found"
}Headers
Resume sequence when after is omitted.
Query Parameters
Exclusive sequence. Takes priority over Last-Event-ID.
Required range:
x >= 0Rows fetched per poll. Default 200, maximum 500.
Required range:
1 <= x <= 500Response
SSE stream
The response is of type string.
Example:
"id: 12\nevent: l1Action\ndata: {\"explorerId\":\"0x...\"}\n"