curl --request POST \
--url https://api.scanify.com.br/extract/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": {
"fileUrl": "<string>",
"fileBase64": "<string>",
"filename": "<string>"
},
"referenceId": "<string>",
"metadata": {},
"includeMarkdown": false,
"timeout": 60000
}
'import requests
url = "https://api.scanify.com.br/extract/sync"
payload = {
"file": {
"fileUrl": "<string>",
"fileBase64": "<string>",
"filename": "<string>"
},
"referenceId": "<string>",
"metadata": {},
"includeMarkdown": False,
"timeout": 60000
}
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({
file: {fileUrl: '<string>', fileBase64: '<string>', filename: '<string>'},
referenceId: '<string>',
metadata: {},
includeMarkdown: false,
timeout: 60000
})
};
fetch('https://api.scanify.com.br/extract/sync', 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.scanify.com.br/extract/sync",
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([
'file' => [
'fileUrl' => '<string>',
'fileBase64' => '<string>',
'filename' => '<string>'
],
'referenceId' => '<string>',
'metadata' => [
],
'includeMarkdown' => false,
'timeout' => 60000
]),
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.scanify.com.br/extract/sync"
payload := strings.NewReader("{\n \"file\": {\n \"fileUrl\": \"<string>\",\n \"fileBase64\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"referenceId\": \"<string>\",\n \"metadata\": {},\n \"includeMarkdown\": false,\n \"timeout\": 60000\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.scanify.com.br/extract/sync")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file\": {\n \"fileUrl\": \"<string>\",\n \"fileBase64\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"referenceId\": \"<string>\",\n \"metadata\": {},\n \"includeMarkdown\": false,\n \"timeout\": 60000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scanify.com.br/extract/sync")
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 \"file\": {\n \"fileUrl\": \"<string>\",\n \"fileBase64\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"referenceId\": \"<string>\",\n \"metadata\": {},\n \"includeMarkdown\": false,\n \"timeout\": 60000\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"document_type": "NFE",
"status": "success",
"fields": {},
"processed_at": "2023-11-07T05:31:56Z",
"scanify": {
"reliability_score": 123,
"reliability_level": "high",
"missing_fields": [
"<string>"
],
"inconsistencies": [
"<string>"
],
"summary": "<string>",
"schema_version": "<string>",
"confidence_heatmap": {},
"document_type_detection": {
"source": "provided",
"provided_document_type": "<string>",
"detected_document_type": "<string>",
"confidence": 123,
"threshold": 123,
"accepted": true,
"reason": "<string>"
}
},
"markdown": "<string>"
}{
"message": "<string>",
"request_id": "<string>"
}{
"error": "Unauthorized"
}{
"success": false,
"status": "failed",
"code": "SYNC_TIMEOUT",
"message": "<string>",
"request_id": "<string>"
}Extração síncrona
Extrai os campos de um documento de forma síncrona, aguardando o processamento concluir e retornando o resultado completo na mesma requisição. Use o parâmetro timeout para controlar o tempo máximo de espera.
curl --request POST \
--url https://api.scanify.com.br/extract/sync \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"file": {
"fileUrl": "<string>",
"fileBase64": "<string>",
"filename": "<string>"
},
"referenceId": "<string>",
"metadata": {},
"includeMarkdown": false,
"timeout": 60000
}
'import requests
url = "https://api.scanify.com.br/extract/sync"
payload = {
"file": {
"fileUrl": "<string>",
"fileBase64": "<string>",
"filename": "<string>"
},
"referenceId": "<string>",
"metadata": {},
"includeMarkdown": False,
"timeout": 60000
}
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({
file: {fileUrl: '<string>', fileBase64: '<string>', filename: '<string>'},
referenceId: '<string>',
metadata: {},
includeMarkdown: false,
timeout: 60000
})
};
fetch('https://api.scanify.com.br/extract/sync', 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.scanify.com.br/extract/sync",
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([
'file' => [
'fileUrl' => '<string>',
'fileBase64' => '<string>',
'filename' => '<string>'
],
'referenceId' => '<string>',
'metadata' => [
],
'includeMarkdown' => false,
'timeout' => 60000
]),
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.scanify.com.br/extract/sync"
payload := strings.NewReader("{\n \"file\": {\n \"fileUrl\": \"<string>\",\n \"fileBase64\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"referenceId\": \"<string>\",\n \"metadata\": {},\n \"includeMarkdown\": false,\n \"timeout\": 60000\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.scanify.com.br/extract/sync")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"file\": {\n \"fileUrl\": \"<string>\",\n \"fileBase64\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"referenceId\": \"<string>\",\n \"metadata\": {},\n \"includeMarkdown\": false,\n \"timeout\": 60000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scanify.com.br/extract/sync")
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 \"file\": {\n \"fileUrl\": \"<string>\",\n \"fileBase64\": \"<string>\",\n \"filename\": \"<string>\"\n },\n \"referenceId\": \"<string>\",\n \"metadata\": {},\n \"includeMarkdown\": false,\n \"timeout\": 60000\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"document_type": "NFE",
"status": "success",
"fields": {},
"processed_at": "2023-11-07T05:31:56Z",
"scanify": {
"reliability_score": 123,
"reliability_level": "high",
"missing_fields": [
"<string>"
],
"inconsistencies": [
"<string>"
],
"summary": "<string>",
"schema_version": "<string>",
"confidence_heatmap": {},
"document_type_detection": {
"source": "provided",
"provided_document_type": "<string>",
"detected_document_type": "<string>",
"confidence": 123,
"threshold": 123,
"accepted": true,
"reason": "<string>"
}
},
"markdown": "<string>"
}{
"message": "<string>",
"request_id": "<string>"
}{
"error": "Unauthorized"
}{
"success": false,
"status": "failed",
"code": "SYNC_TIMEOUT",
"message": "<string>",
"request_id": "<string>"
}timeout para limitar a espera (10s–300s).
Exemplos
curl -X POST https://api.scanify.com.br/extract/sync \
-H "Authorization: Bearer SUA_CHAVE_DE_API" \
-H "Content-Type: application/json" \
-d '{
"file": {
"fileUrl": "https://exemplo.com/documento.pdf"
},
"documentType": "NFE",
"includeMarkdown": false,
"timeout": 60000
}'
import axios from 'axios';
const { data } = await axios.post(
'https://api.scanify.com.br/extract/sync',
{
file: {
fileUrl: 'https://exemplo.com/documento.pdf',
},
documentType: 'NFE',
includeMarkdown: false,
timeout: 60000,
},
{
headers: {
Authorization: 'Bearer SUA_CHAVE_DE_API',
},
},
);
console.log(data.fields);
import requests
response = requests.post(
"https://api.scanify.com.br/extract/sync",
headers={"Authorization": "Bearer SUA_CHAVE_DE_API"},
json={
"file": {
"fileUrl": "https://exemplo.com/documento.pdf",
},
"documentType": "NFE",
"includeMarkdown": False,
"timeout": 60000,
},
timeout=70,
)
response.raise_for_status()
print(response.json()["fields"])
Authorizations
Chave de API enviada no cabeçalho Authorization no formato: Authorization: Bearer <API_KEY>.
Body
Origem do arquivo. Forneça fileUrl OU fileBase64 (com filename obrigatório), nunca ambos.
Show child attributes
Show child attributes
Tipo de documento. Quando omitido na extração, o tipo é detectado automaticamente.
NFE, BOLETO, CONTRATO, RECIBO, CNH, RG, COMPROVANTE_RESIDENCIA, CONTRATO_SOCIAL, IRPF, CERTIDAO_NASCIMENTO, CERTIDAO_CASAMENTO, LAUDO_MEDICO, CERTIDAO_OBITO, PROCURACAO, HOLERITE, DOCUMENTO_VEICULAR, DOCUMENTO_JURIDICO, EXTRATO_BANCARIO, INFORME_RENDIMENTOS_EMPREGADOR_INSS, INFORME_RENDIMENTOS_BANCOS, INFORME_RENDIMENTOS_CORRETORAS, INFORME_PLANO_SAUDE, DESPESA_MEDICA, COMPROVANTE_EDUCACAO, DECLARACAO_IR_ANTERIOR Identificador externo para rastreamento.
Metadados arbitrários associados à requisição.
Inclui o markdown do documento no resultado.
Tempo máximo de espera em milissegundos.
10000 <= x <= 300000Response
Extração concluída.
Resultado completo de uma extração síncrona.
Tipo de documento. Quando omitido na extração, o tipo é detectado automaticamente.
NFE, BOLETO, CONTRATO, RECIBO, CNH, RG, COMPROVANTE_RESIDENCIA, CONTRATO_SOCIAL, IRPF, CERTIDAO_NASCIMENTO, CERTIDAO_CASAMENTO, LAUDO_MEDICO, CERTIDAO_OBITO, PROCURACAO, HOLERITE, DOCUMENTO_VEICULAR, DOCUMENTO_JURIDICO, EXTRATO_BANCARIO, INFORME_RENDIMENTOS_EMPREGADOR_INSS, INFORME_RENDIMENTOS_BANCOS, INFORME_RENDIMENTOS_CORRETORAS, INFORME_PLANO_SAUDE, DESPESA_MEDICA, COMPROVANTE_EDUCACAO, DECLARACAO_IR_ANTERIOR success, partial_success, failed Mapa de nome do campo para o valor extraído.
Show child attributes
Show child attributes
Metadados de qualidade da extração.
Show child attributes
Show child attributes
Markdown do documento, presente quando includeMarkdown=true.