Screenshot to Table API

Category: ai

Extract tabular data from screenshots using OCR and AI to produce clean CSV output.

Endpoint

POST https://anythingtext.com/api/tools/screenshot2table
Authentication Required Content-Type: multipart/form-data

Authentication

This API requires an API key. Generate one from the API Keys section in your dashboard settings.

Include the X-API-Key header in all API requests:

X-API-Key: atk_your_api_key_here

Rate Limiting

API requests are limited to 60 requests per minute per user. If you exceed this limit, the API returns a 429 Too Many Requests response.

Every response includes rate limit headers:

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
X-RateLimit-Reset: 42

When rate limited, the response body contains:

{ "error": "Rate limit exceeded. Maximum 60 requests per minute.", "retryAfter": 42, "limit": 60 }

Request Parameters

Name Type Required Description
file File Required Screenshot image (PNG, JPG)
Example: table_screenshot.png

Response

Content-Type: application/json

Extracted CSV data and raw OCR text

{
  "csv": "name,age\nAlice,30\nBob,25",
  "rawText": "Name Age Alice 30 Bob 25"
}

Error Responses

StatusDescriptionBody
401 Not authenticated {"error": "Please log in..."}
400 Bad request / Missing required params {"error": "... is required"}
500 Internal server error {"error": "Failed to ..."}

cURL Example

curl -X POST https://anythingtext.com/api/tools/screenshot2table \
  -H "X-API-Key: your_api_key_here" \
  -F "file=@table_screenshot.png"

Code Samples

const formData = new FormData();
formData.append('file', fileInput.files[0]);

const response = await fetch('https://anythingtext.com/api/tools/screenshot2table', {
    method: 'POST',
    headers: { 'X-API-Key': 'your_api_key_here' },
    body: formData
});

const data = await response.json();
console.log('Result:', data);
import requests

with open('input_file', 'rb') as f:
    response = requests.post(
        'https://anythingtext.com/api/tools/screenshot2table',
        files={'file': f},
        headers={'X-API-Key': 'your_api_key_here'}
    )

data = response.json()
print('Result:', data)
import java.net.URI;
import java.net.http.*;
import java.nio.file.*;

HttpClient client = HttpClient.newHttpClient();
String boundary = "----Boundary" + System.currentTimeMillis();
byte[] fileBytes = Files.readAllBytes(Path.of("input_file"));

String body = "--" + boundary + "\r\n"
    + "Content-Disposition: form-data; name=\"file\"; filename=\"input_file\"\r\n"
    + "Content-Type: application/octet-stream\r\n\r\n";
String end = "\r\n--" + boundary + "--";

byte[] prefix = body.getBytes();
byte[] suffix = end.getBytes();
byte[] full = new byte[prefix.length + fileBytes.length + suffix.length];
System.arraycopy(prefix, 0, full, 0, prefix.length);
System.arraycopy(fileBytes, 0, full, prefix.length, fileBytes.length);
System.arraycopy(suffix, 0, full, prefix.length + fileBytes.length, suffix.length);

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://anythingtext.com/api/tools/screenshot2table"))
    .header("Content-Type", "multipart/form-data; boundary=" + boundary)
    .header("X-API-Key", "your_api_key_here")
    .POST(HttpRequest.BodyPublishers.ofByteArray(full))
    .build();

HttpResponse<String> response = client.send(request,
    HttpResponse.BodyHandlers.ofString());

System.out.println("Response: " + response.body());