cURL
curl 'https://api.gumloop.com/api/v1/browser-profiles/default/cookies' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"url": "https://mail.google.com", "cookies": [{"name": "SID", "value": "...", "domain": ".google.com", "path": "/", "secure": true, "httpOnly": true, "expirationDate": 1790000000}]}'from gumloop import Gumloop
client = Gumloop(access_token="YOUR_ACCESS_TOKEN")
result = client.browser_profiles.import_cookies("default", url="https://mail.google.com", cookies=cookies)
print(result.imported.site, result.imported.cookie_count)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cookies: [{}], url: '<string>', team_id: '<string>'})
};
fetch('https://api.gumloop.com/api/v1/browser-profiles/{profile_id}/cookies', 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.gumloop.com/api/v1/browser-profiles/{profile_id}/cookies",
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([
'cookies' => [
[
]
],
'url' => '<string>',
'team_id' => '<string>'
]),
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://api.gumloop.com/api/v1/browser-profiles/{profile_id}/cookies"
payload := strings.NewReader("{\n \"cookies\": [\n {}\n ],\n \"url\": \"<string>\",\n \"team_id\": \"<string>\"\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://api.gumloop.com/api/v1/browser-profiles/{profile_id}/cookies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cookies\": [\n {}\n ],\n \"url\": \"<string>\",\n \"team_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gumloop.com/api/v1/browser-profiles/{profile_id}/cookies")
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 \"cookies\": [\n {}\n ],\n \"url\": \"<string>\",\n \"team_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"profile": {
"profile_id": "<string>",
"owner_id": "<string>",
"owner_scope": "personal",
"name": "<string>",
"is_default": true,
"version": 123,
"sites": [
{
"domain": "<string>",
"cookie_count": 123,
"updated_ts": "2023-11-07T05:31:56Z"
}
],
"size_bytes": 123,
"has_storage": true,
"created_by_user_id": "<string>",
"created_ts": "2023-11-07T05:31:56Z",
"updated_ts": "2023-11-07T05:31:56Z",
"last_used_ts": "2023-11-07T05:31:56Z"
},
"imported": {
"site": "<string>",
"cookie_count": 123,
"skipped": 123,
"sites": [
"<string>"
]
}
}Import cookies into a browser profile
Add sign-in cookies to a browser profile. This is what gumloop browser import-logins calls. Send the cookies in Chrome extension (chrome.cookies.Cookie) or Chrome DevTools Protocol Cookie shape.
POST
/
browser-profiles
/
{profile_id}
/
cookies
cURL
curl 'https://api.gumloop.com/api/v1/browser-profiles/default/cookies' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"url": "https://mail.google.com", "cookies": [{"name": "SID", "value": "...", "domain": ".google.com", "path": "/", "secure": true, "httpOnly": true, "expirationDate": 1790000000}]}'from gumloop import Gumloop
client = Gumloop(access_token="YOUR_ACCESS_TOKEN")
result = client.browser_profiles.import_cookies("default", url="https://mail.google.com", cookies=cookies)
print(result.imported.site, result.imported.cookie_count)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({cookies: [{}], url: '<string>', team_id: '<string>'})
};
fetch('https://api.gumloop.com/api/v1/browser-profiles/{profile_id}/cookies', 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.gumloop.com/api/v1/browser-profiles/{profile_id}/cookies",
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([
'cookies' => [
[
]
],
'url' => '<string>',
'team_id' => '<string>'
]),
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://api.gumloop.com/api/v1/browser-profiles/{profile_id}/cookies"
payload := strings.NewReader("{\n \"cookies\": [\n {}\n ],\n \"url\": \"<string>\",\n \"team_id\": \"<string>\"\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://api.gumloop.com/api/v1/browser-profiles/{profile_id}/cookies")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cookies\": [\n {}\n ],\n \"url\": \"<string>\",\n \"team_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gumloop.com/api/v1/browser-profiles/{profile_id}/cookies")
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 \"cookies\": [\n {}\n ],\n \"url\": \"<string>\",\n \"team_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"profile": {
"profile_id": "<string>",
"owner_id": "<string>",
"owner_scope": "personal",
"name": "<string>",
"is_default": true,
"version": 123,
"sites": [
{
"domain": "<string>",
"cookie_count": 123,
"updated_ts": "2023-11-07T05:31:56Z"
}
],
"size_bytes": 123,
"has_storage": true,
"created_by_user_id": "<string>",
"created_ts": "2023-11-07T05:31:56Z",
"updated_ts": "2023-11-07T05:31:56Z",
"last_used_ts": "2023-11-07T05:31:56Z"
},
"imported": {
"site": "<string>",
"cookie_count": 123,
"skipped": 123,
"sites": [
"<string>"
]
}
}Which cookies are kept, and how are they stored?
Which cookies are kept, and how are they stored?
With
url, only that site’s cookies are kept and the import replaces that site; without it, every site in the payload is imported. Cookies are encrypted with the profile’s key before storage and are never returned by any endpoint.Use default as the profile_id to import into the owner’s default profile, creating it if needed.Authorizations
A personal API key or an OAuth 2.0 access token. Personal API keys also require the x-auth-key header with your user ID.
Body
application/json
Was this page helpful?