YetAnotherAPI Documentation
Signup for APIGo to main websiteContact Support
  • API Documentation
    • YetAnotherAPI Overview
    • Authentication
  • Integrations
    • Pabbly-Connect
  • Document parser
    • PDF Parser
    • Doc Parser
    • PNG & JPG Parser
    • TXT Parser
    • Parser Processing Status
  • Web Scrapper [deprecated]
    • Basic Web Scraper
    • LLM Web Scraper
    • Scrapper Processing Status
  • Web Scraper
    • Basic Web Scraper
    • Webpage links Scrapper
    • Metadata Scrapper
    • Webhook Notification
    • Status Check
  • LLM Web Scraper
    • Basic Text
    • Structured JSON
    • Best Practices
    • Use Cases
    • Status Check
  • UChat Webhook System
Powered by GitBook
On this page
  • Document Processing Status Checking Guide
  • Overview
  • Endpoint
  • Authentication
  • Response States
  • Status Codes
  • Example Usage
  • Polling Recommendations
  • Error Handling
  • Best Practices

Was this helpful?

  1. Document parser

Parser Processing Status

Document Processing Status Checking Guide

Overview

The status checking endpoint allows you to monitor the progress of your document processing requests and retrieve results.

Endpoint

GET /documents/status/{requestId}

Base URL: https://api.yetanotherapi.com

Authentication

x-api-key: YOUR_API_KEY

Response States

1. Processing State

{
    "requestId": "string",
    "status": "PROCESSING",
    "type": "string",        // Document type (pdf, doc, etc.)
    "createdAt": "number"    // Unix timestamp
}

2. Completed State

{
    "requestId": "string",
    "status": "COMPLETED",
    "type": "string",
    "createdAt": "number",
    "data": "string"         // Extracted text content with page separators
}

3. Failed State

{
    "requestId": "string",
    "status": "FAILED",
    "type": "string",
    "createdAt": "number",
    "error": "string"        // Error description
}

Status Codes

  • 200: Status retrieved successfully

  • 404: Request ID not found

  • 401: Invalid API key

  • 500: Internal server error

Example Usage

cURL Example

curl --location 'https://api.yetanotherapi.com/documents/status/7a509d7c-f61b-4755-a09a-d5782ca27489' \
--header 'x-api-key: YOUR_API_KEY'

Python Example

import requests

api_key = "YOUR_API_KEY"
request_id = "7a509d7c-f61b-4755-a09a-d5782ca27489"

response = requests.get(
    f"https://api.yetanotherapi.com/documents/status/{request_id}",
    headers={"x-api-key": api_key}
)

print(response.json())

Polling Recommendations

  • Initial check: Wait 5 seconds after submission

  • Subsequent checks: Every 10 seconds

  • Maximum polling duration: 10 minutes

  • Implement exponential backoff for long-running processes

Error Handling

Error Code
Description

404-001

Request ID not found

404-002

Request expired (older than 7 days)

401-001

Invalid API key

500-001

Internal server error

Best Practices

  1. Implement exponential backoff in polling

  2. Handle all possible status codes

  3. Use webhook notifications for long-running processes

  4. Store request IDs for future reference

  5. Check expiration (7 days) for old requests

PreviousTXT ParserNextWeb Scrapper [deprecated]

Last updated 5 months ago

Was this helpful?