cURL
curl https://api.tryseeqr.com/v1/scan \
-H "Authorization: Bearer $SEEQR_API_KEY" \
-F image=@./invoice.pngNode.js (fetch)
const res = await fetch("https://api.tryseeqr.com/v1/scan", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SEEQR_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ image_url: imageUrl }),
});
if (!res.ok) throw new Error(`Seeqr error: ${res.status}`);
const { decoded, safety } = await res.json();React file input
import { useState } from "react";
import { decodeLocal } from "@seeqr/client/browser";
export function ScanField() {
const [value, setValue] = useState("");
return (
<input
type="file"
accept="image/*"
onChange={async (e) => {
const file = e.target.files?.[0];
if (!file) return;
const { decoded } = await decodeLocal(file);
setValue(decoded);
}}
/>
);
}Python
import os, requests
res = requests.post(
"https://api.tryseeqr.com/v1/scan",
headers={"Authorization": f"Bearer {os.environ['SEEQR_API_KEY']}"},
json={"image_url": image_url},
timeout=15,
)
res.raise_for_status()
print(res.json()["decoded"])