Create a new session
curl --request POST \
--url https://emereg.com/api/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": 5,
"timeout": 60,
"browser_settings": {
"proxy": {
"country": "sg"
},
"record_live": true
}
}
'import requests
url = "https://emereg.com/api/v1/sessions"
payload = {
"project_id": 5,
"timeout": 60,
"browser_settings": {
"proxy": { "country": "sg" },
"record_live": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: 5,
timeout: 60,
browser_settings: {proxy: {country: 'sg'}, record_live: true}
})
};
fetch('https://emereg.com/api/v1/sessions', 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://emereg.com/api/v1/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => 5,
'timeout' => 60,
'browser_settings' => [
'proxy' => [
'country' => 'sg'
],
'record_live' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://emereg.com/api/v1/sessions"
payload := strings.NewReader("{\n \"project_id\": 5,\n \"timeout\": 60,\n \"browser_settings\": {\n \"proxy\": {\n \"country\": \"sg\"\n },\n \"record_live\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://emereg.com/api/v1/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": 5,\n \"timeout\": 60,\n \"browser_settings\": {\n \"proxy\": {\n \"country\": \"sg\"\n },\n \"record_live\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://emereg.com/api/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": 5,\n \"timeout\": 60,\n \"browser_settings\": {\n \"proxy\": {\n \"country\": \"sg\"\n },\n \"record_live\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"project_id": 5,
"browser_settings": {
"proxy": {
"country": "sg"
},
"record_live": true,
"live_url": "https://emereg.com/session/inspector.html?wss=browser.emereg.com/devtools/page/803F10EB7C3970E4808993EDB1870FD2"
},
"timeout": 60,
"started_at": "2024-08-14T05:47:21Z",
"status": "STARTED",
"created_at": "2024-08-14T13:47:16.368Z",
"updated_at": "2024-08-14T13:47:21.682Z",
"browser_id": "0787ef97-70d3-492a-a83a-f0408a21b115"
}Sessions Endpoint
create
POST
/
api
/
v1
/
sessions
Create a new session
curl --request POST \
--url https://emereg.com/api/v1/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project_id": 5,
"timeout": 60,
"browser_settings": {
"proxy": {
"country": "sg"
},
"record_live": true
}
}
'import requests
url = "https://emereg.com/api/v1/sessions"
payload = {
"project_id": 5,
"timeout": 60,
"browser_settings": {
"proxy": { "country": "sg" },
"record_live": True
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project_id: 5,
timeout: 60,
browser_settings: {proxy: {country: 'sg'}, record_live: true}
})
};
fetch('https://emereg.com/api/v1/sessions', 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://emereg.com/api/v1/sessions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => 5,
'timeout' => 60,
'browser_settings' => [
'proxy' => [
'country' => 'sg'
],
'record_live' => true
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://emereg.com/api/v1/sessions"
payload := strings.NewReader("{\n \"project_id\": 5,\n \"timeout\": 60,\n \"browser_settings\": {\n \"proxy\": {\n \"country\": \"sg\"\n },\n \"record_live\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://emereg.com/api/v1/sessions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project_id\": 5,\n \"timeout\": 60,\n \"browser_settings\": {\n \"proxy\": {\n \"country\": \"sg\"\n },\n \"record_live\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://emereg.com/api/v1/sessions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project_id\": 5,\n \"timeout\": 60,\n \"browser_settings\": {\n \"proxy\": {\n \"country\": \"sg\"\n },\n \"record_live\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"project_id": 5,
"browser_settings": {
"proxy": {
"country": "sg"
},
"record_live": true,
"live_url": "https://emereg.com/session/inspector.html?wss=browser.emereg.com/devtools/page/803F10EB7C3970E4808993EDB1870FD2"
},
"timeout": 60,
"started_at": "2024-08-14T05:47:21Z",
"status": "STARTED",
"created_at": "2024-08-14T13:47:16.368Z",
"updated_at": "2024-08-14T13:47:21.682Z",
"browser_id": "0787ef97-70d3-492a-a83a-f0408a21b115"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
201 - application/json
Successfully created the session.
ID of the project associated with the session.
Show child attributes
Show child attributes
Timeout duration for the session in seconds.
Timestamp the session was started.
Current status of the session.
Timestamp the session was created.
Timestamp the session was last updated.
Unique identifier for the browser session.
⌘I