This guide explains the Tools API, which provides various text analysis and processing capabilities.

This guide covers the key endpoints available in Writer’s Tools API, which provides various text analysis and processing capabilities.

Each of these endpoints incurs different usage charges. See the pricing page for more information.

Your API key can be generated using these steps.

Context-aware text splitting

The context-aware splitting endpoint provides intelligent text splitting capabilities for long documents (up to 4000 words). Unlike simple character-based splitting, it preserves the semantic meaning and context between chunks, making it ideal for processing long-form content while maintaining coherence.

Use cases

  • Breaking down long articles or research papers for improved readability
  • Preparing content for chunked processing in RAG (Retrieval-Augmented Generation) systems
  • Splitting lengthy legal documents while maintaining context around clauses and references
  • Creating digestible sections of educational content while preserving logical flow
  • Processing large documentation files for knowledge base creation

Request

  • text: The text content to be split (required)
  • strategy: The splitting strategy to use (required). Options include:
    • llm_split: Uses language model for precise semantic splitting
    • fast_split: Uses heuristic-based approach for quick splitting
    • hybrid_split: Combines both approaches

Response

Returns an array of text chunks, with at least one chunk guaranteed. Each chunk maintains semantic coherence while preserving the context of the original text.

Example code

Here’s how to use the context-aware text splitting endpoint:

Medical comprehend

The medical comprehend endpoint analyzes unstructured medical text to extract entities and label them with standardized medical codes. Each extracted entity comes with a confidence score, making it useful for processing clinical notes, medical records, and other healthcare-related documents.

Use cases

  • Automating medical records processing and classification
  • Extracting diagnosis codes from clinical notes for billing and insurance purposes
  • Creating structured datasets from unstructured medical documentation
  • Identifying and categorizing medications and their attributes in patient records
  • Standardizing medical terminology across different healthcare systems using SNOMED CT codes

Request

  • content: The medical text to analyze (required)
  • response_type: The desired response format (required). Options include:
    • Entities: Returns medical entities with their categories.
    • RxNorm: RxNorm provides normalized names and unique identifiers for medicines and drugs, allowing computer systems to communicate drug-related information efficiently and unambiguously.
    • ICD-10-CM: ICD-10-CM is a standardized system used to code diseases and medical conditions (morbidity) data.
    • SNOMED CT: SNOMED CT is a standardized, multilingual vocabulary of clinical terminology that is used by physicians and other healthcare providers for the electronic exchange of health information.

Response

Returns an array of medical entities, where each entity includes:

  • category: The medical category of the entity
  • text: The actual text that was identified
  • score: Confidence score for the entity (0-1)
  • traits: Array of trait objects with names and scores
  • concepts: Array of medical concepts with codes and descriptions
  • attributes: Related attributes with their own scores and relationships
  • type: The entity type
  • Position information (begin_offset and end_offset)

Example code

Here’s how to analyze medical text using the medical comprehend endpoint:

PDF parser

The PDF parser endpoint converts PDF documents into other formats. This is particularly useful when you need to extract and process text content from PDF files for further analysis or integration into your workflow.

Use cases

  • Converting research papers from PDF to searchable text for analysis
  • Extracting content from business reports for data processing
  • Converting PDF documentation into markdown format for web publishing
  • Making archived PDF documents searchable and analyzable
  • Automating data extraction from PDF forms and invoices

File upload

Before using the PDF parser, you’ll need to upload your PDF file to Writer to obtain a file ID. Use the files API upload endpoint to upload your document:

Request

  • file_id: The unique identifier of the PDF file (required, path parameter)
  • format: The desired output format (required). Options:
    • text: Plain text output
    • markdown: Formatted markdown output

Response

Returns an object with a content field containing the extracted text in the specified format.

Example code

Once you have a file ID, here’s how to parse the PDF content:

You now know how to use the key endpoints available in Writer’s Tools API. For more details, refer to the API reference.