Get the authenticated viewer
curl --request GET \
--url https://api.brandfetch.io/v2/viewer \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brandfetch.io/v2/viewer"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.brandfetch.io/v2/viewer', 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.brandfetch.io/v2/viewer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.brandfetch.io/v2/viewer"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.brandfetch.io/v2/viewer")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brandfetch.io/v2/viewer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"type": "api-key",
"id": "id5ZQvmz9A",
"urn": "urn:brandfetch:organization:cl5s9fps1275071ol9h7gs072m:api-key:id5ZQvmz9A",
"name": "Production key",
"createdAt": "2026-05-12T09:14:07.000Z",
"usage": {
"used": 1234,
"quota": 250000
},
"organization": {
"id": "cl5s9fps1275071ol9h7gs072m",
"urn": "urn:brandfetch:organization:cl5s9fps1275071ol9h7gs072m",
"name": "Acme Inc."
}
}Viewer API
Viewer API
Check which API key or session a request is authenticated with by calling GET /v2/viewer, which is useful for verifying a credential.
GET
/
v2
/
viewer
Get the authenticated viewer
curl --request GET \
--url https://api.brandfetch.io/v2/viewer \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.brandfetch.io/v2/viewer"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.brandfetch.io/v2/viewer', 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.brandfetch.io/v2/viewer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.brandfetch.io/v2/viewer"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.brandfetch.io/v2/viewer")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.brandfetch.io/v2/viewer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"type": "api-key",
"id": "id5ZQvmz9A",
"urn": "urn:brandfetch:organization:cl5s9fps1275071ol9h7gs072m:api-key:id5ZQvmz9A",
"name": "Production key",
"createdAt": "2026-05-12T09:14:07.000Z",
"usage": {
"used": 1234,
"quota": 250000
},
"organization": {
"id": "cl5s9fps1275071ol9h7gs072m",
"urn": "urn:brandfetch:organization:cl5s9fps1275071ol9h7gs072m",
"name": "Acme Inc."
}
}Calling this endpoint is free. It never consumes API credits, so you
can use it to verify a credential during integration setup or on a health
check. API key responses include the key’s current credit
usage, matching
the x-api-key-quota and x-api-key-approximate-usage headers returned by
billable endpoints.Authorizations
Response
The presented credential is valid. The type property indicates which kind of credential authenticated the request and determines the response shape.
- API key
- User
The authenticated API key.
Was this page helpful?