Scan a card
curl --request POST \
--url https://api.cromos.so/v1/scan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form image='@example-file'import requests
url = "https://api.cromos.so/v1/scan"
files = { "image": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('image', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.cromos.so/v1/scan', 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.cromos.so/v1/scan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.cromos.so/v1/scan"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.cromos.so/v1/scan")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cromos.so/v1/scan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"data": {
"analysis": {
"game": "<string>"
},
"matches": [
{
"score": 123,
"card": {
"id": "<string>",
"name": "<string>",
"category": "<string>",
"rarity": "<string>",
"number": "<string>",
"image": {
"low": "<string>",
"high": "<string>"
},
"expansion": {
"id": "<string>",
"name": "<string>"
}
}
}
]
},
"error": {}
}{
"data": {},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"data": {},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"data": {},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"data": {},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"data": null,
"error": {
"code": "scan_unavailable",
"message": "scanning is not configured"
}
}Scanning
Scan a card
Identify a card from a photo.
POST
/
v1
/
scan
Scan a card
curl --request POST \
--url https://api.cromos.so/v1/scan \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form image='@example-file'import requests
url = "https://api.cromos.so/v1/scan"
files = { "image": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('image', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.cromos.so/v1/scan', 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.cromos.so/v1/scan",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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.cromos.so/v1/scan"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.cromos.so/v1/scan")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cromos.so/v1/scan")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"image\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"data": {
"analysis": {
"game": "<string>"
},
"matches": [
{
"score": 123,
"card": {
"id": "<string>",
"name": "<string>",
"category": "<string>",
"rarity": "<string>",
"number": "<string>",
"image": {
"low": "<string>",
"high": "<string>"
},
"expansion": {
"id": "<string>",
"name": "<string>"
}
}
}
]
},
"error": {}
}{
"data": {},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"data": {},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"data": {},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"data": {},
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"data": null,
"error": {
"code": "scan_unavailable",
"message": "scanning is not configured"
}
}POST /v1/scan identifies a trading card from a photo of it. Send a cropped, roughly
straight-on photo of a single card; the response lists the closest catalog matches with a
confidence score each.
Send a file
Sendmultipart/form-data with the photo in an image field (max 10 MB):
curl -X POST https://api.cromos.so/v1/scan \
-H "Authorization: Bearer $API_KEY" \
-F "image=@card.jpg"
Send a URL
Sendapplication/json with a publicly reachable https URL (max 10 MB, no redirects):
curl -X POST https://api.cromos.so/v1/scan \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://images.example.com/card.jpg"}'
The response
{
"data": {
"analysis": { "game": "pokemon" },
"matches": [
{
"score": 0.91,
"card": {
"id": "base1-4",
"name": "Charizard",
"category": "Pokemon",
"rarity": "Rare",
"number": "4",
"image": { "low": "…", "high": "…" },
"expansion": { "id": "base1", "name": "Base Set" }
}
}
]
},
"error": null
}
scoreis a similarity from 0 to 1; higher is better. Matches are best-first.- A confident scan returns a single match. A close race returns up to five — show them and let the user pick.
- Empty
matches(with"game": null) is a valid 200, not an error: nothing in the catalog cleared the confidence floor. Prompt for a retake — closer, straighter, less glare. - Photos are processed in memory and never stored.
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request | Body is not one of the two supported shapes |
| 400 | unsupported_image | Bytes are not a decodable image |
| 400 | url_not_allowed | URL is not https, or resolves to a non-public address |
| 400 | url_fetch_failed | URL could not be fetched, redirected, or exceeded the size |
| 413 | payload_too_large | Image larger than 10 MB |
| 503 | scan_unavailable | Scanning is not configured on this deployment |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
multipart/form-dataapplication/json
⌘I