Skip to content
Postman

Prices of an extraction, in credits ​

GET /documents/prices

What an extraction costs now, for each document the API reads: what an answer costs by each engine, what a request without engine holds, and the extra for resizeImage. No API key needed. The prices may change: read them here.

Authentication ​

Public: no API key needed.

Responses ​

200 OK ​

The prices in force

Response fields
  • documents object[]

    One entry per document the API reads.

  • documents[].document string

    The document, as its endpoint names it.

  • documents[].standard number

    Credits a request without engine holds while it runs: the most it costs, the dearer of mini and large. It is charged the price of the engine that answers.

  • documents[].mini number

    Credits for an answer by mini.

  • documents[].large number

    Credits for an answer by large.

  • documents[].fast number

    Credits for an answer by fast, and what a request with engine: "fast" holds. When another engine answers it, the request costs that engine's price, never more.

  • documents[].resizeImage number

    Extra credits when the server resizes the image into our standard, as resizeImage: true asks.

bash
#!/usr/bin/env bash
# The price of an extraction, in credits, for each document: 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
python
"""The price of an extraction, in credits, for each document: 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 price in response.json()["documents"]:
    print(
        f"{price['document']}: standard {price['standard']}, fast {price['fast']}, "
        f"resizeImage +{price['resizeImage']} credit(s)"
    )
js
// The price of an extraction, in credits, for each document: 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 price of (await response.json()).documents) {
  console.log(
    `${price.document}: standard ${price.standard}, fast ${price.fast}, resizeImage +${price.resizeImage} credit(s)`
  )
}
php
<?php
// The price of an extraction, in credits, for each document: 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)['documents'] as $price) {
    echo "{$price['document']}: standard {$price['standard']}, fast {$price['fast']}, "
        . "resizeImage +{$price['resizeImage']} credit(s)", PHP_EOL;
}
java
// The price of an extraction, in credits, for each document: 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. {"documents": [{"document": "birth-certificate", "standard": 1, ...}]};
        // read it with your JSON library
        System.out.println(response.body());
        if (response.statusCode() != 200) {
            System.exit(1);
        }
    }
}
csharp
// The price of an extraction, in credits, for each document: 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.GetProperty("documents").EnumerateArray())
{
    Console.WriteLine(
        $"{price.GetProperty("document")}: standard {price.GetProperty("standard")}, fast {price.GetProperty("fast")}, "
        + $"resizeImage +{price.GetProperty("resizeImage")} credit(s)");
}

Try it

Sends this request to the production API.

This call costs no credits.