Prices of an extraction, in credits
GET /documents/prices
What an extraction costs now: on the standard engines, on the fast engine when the request asks for it, and the extra for resizeImage. No API key needed. fast's price may change: read it here.
Authentication
Public: no API key needed.
Responses
200 OK
The prices in force
Response fields
standardCredits for an extraction answered by the standard engines: a request without
engine.fastCredits for an extraction answered by the fast engine, when the request asks for it with
engine: "fast". When fast cannot answer and a standard engine does, the extraction costsstandard. This price may change: read it here.resizeImageExtra credits when the server resizes the image into our standard, as
resizeImage: trueasks.
#!/usr/bin/env bash
# The price of an extraction, in credits, per engine and for resizeImage.
# A public endpoint: no key needed.
set -euo pipefail
curl -sS --max-time 30 https://api.docsocr.com/api/v1/documents/prices"""The price of an extraction, in credits, per engine and for resizeImage.
A public endpoint: no key needed. Needs the requests package.
"""
import requests
response = requests.get("https://api.docsocr.com/api/v1/documents/prices", timeout=30)
response.raise_for_status()
for name, credits in response.json().items():
print(f"{name}: {credits} credit(s)")// The price of an extraction, in credits, per engine and for resizeImage.
// A public endpoint: no key needed. Needs Node.js 18+.
const response = await fetch('https://api.docsocr.com/api/v1/documents/prices', {
signal: AbortSignal.timeout(30_000),
})
if (!response.ok) {
console.error(response.status)
process.exit(1)
}
for (const [name, credits] of Object.entries(await response.json())) {
console.log(`${name}: ${credits} credit(s)`)
}<?php
// The price of an extraction, in credits, per engine and for resizeImage.
// A public endpoint: no key needed. Needs the curl extension.
$request = curl_init('https://api.docsocr.com/api/v1/documents/prices');
curl_setopt_array($request, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30]);
$body = curl_exec($request);
if ($body === false || curl_getinfo($request, CURLINFO_RESPONSE_CODE) !== 200) {
fwrite(STDERR, 'The price list did not answer' . PHP_EOL);
exit(1);
}
foreach (json_decode($body, true) as $name => $credits) {
echo "$name: $credits credit(s)", PHP_EOL;
}// The price of an extraction, in credits, per engine and for resizeImage.
// A public endpoint: no key needed. Needs Java 17+. Run: java Prices.java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
public class Prices {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder(URI.create("https://api.docsocr.com/api/v1/documents/prices"))
.timeout(Duration.ofSeconds(30))
.GET()
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
// The answer is JSON, e.g. {"standard": 1, ...}; read it with your JSON library
System.out.println(response.body());
if (response.statusCode() != 200) {
System.exit(1);
}
}
}// The price of an extraction, in credits, per engine and for resizeImage.
// A public endpoint: no key needed. Needs .NET 8+. Run: dotnet run Prices.cs (.NET 10)
using System.Text.Json;
using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };
using var prices = JsonDocument.Parse(await http.GetStringAsync("https://api.docsocr.com/api/v1/documents/prices"));
foreach (var price in prices.RootElement.EnumerateObject())
{
Console.WriteLine($"{price.Name}: {price.Value} credit(s)");
}Try it
Sends this request to the production API.
This call costs no credits.