ApyHub API

The ApyHub API provides utility APIs for document conversion, PDF generation, data extraction, image processing, and currency exchange that developers can integrate quickly into their applications.

OpenAPI Specification

apyhub-openapi.yaml Raw ↑
openapi: 3.0.3
info:
  title: ApyHub API
  description: >-
    The ApyHub API provides a collection of utility APIs for common development tasks
    including PDF generation, document conversion (HTML to PDF, Word to PDF), data
    extraction, image processing, currency exchange rates, and more. Developers can
    integrate these pre-built utilities into their applications quickly.
  version: 1.0.0
  contact:
    name: ApyHub
    url: https://apyhub.com/docs
  license:
    name: Proprietary
servers:
  - url: https://api.apyhub.com
    description: ApyHub API
security:
  - apiKeyAuth: []
tags:
  - name: Convert
    description: Document conversion utilities
  - name: Generate
    description: Document generation utilities
  - name: Extract
    description: Data extraction utilities
  - name: Currency
    description: Currency conversion utilities
paths:
  /convert/html/pdf:
    post:
      operationId: convertHtmlToPdf
      summary: ApyHub - Convert HTML to PDF
      description: Converts an HTML file or URL to a PDF document
      tags:
        - Convert
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: URL of the HTML page or file to convert to PDF
                filename:
                  type: string
                  description: Output filename for the generated PDF
            examples:
              ConvertHtmlExample:
                x-microcks-default: true
                summary: Example HTML to PDF conversion request
                value:
                  url: https://example.com/report.html
                  filename: report.pdf
      responses:
        '200':
          description: PDF generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionResult'
              examples:
                ConversionResultExample:
                  x-microcks-default: true
                  summary: Example conversion result
                  value:
                    requestId: conv-abc123
                    status: completed
                    outputUrl: https://cdn.apyhub.com/output/report.pdf
        '400':
          description: Invalid request body
        '401':
          description: Unauthorized - invalid or missing API key
  /convert/word/pdf:
    post:
      operationId: convertWordToPdf
      summary: ApyHub - Convert Word to PDF
      description: Converts a Word document (.docx) to PDF format
      tags:
        - Convert
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: Word document file to convert
                filename:
                  type: string
                  description: Output filename for the PDF
            examples:
              ConvertWordExample:
                x-microcks-default: true
                summary: Example Word to PDF conversion
                value:
                  filename: converted.pdf
      responses:
        '200':
          description: PDF conversion successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionResult'
        '400':
          description: Invalid file or request
        '401':
          description: Unauthorized - invalid or missing API key
  /generate/pdf:
    post:
      operationId: generatePdf
      summary: ApyHub - Generate PDF
      description: Generates a PDF from a template with dynamic data
      tags:
        - Generate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                templateUrl:
                  type: string
                  description: URL of the HTML template to use for PDF generation
                data:
                  type: object
                  description: Dynamic data to inject into the template
            examples:
              GeneratePdfExample:
                x-microcks-default: true
                summary: Example PDF generation request
                value:
                  templateUrl: https://example.com/invoice-template.html
                  data:
                    invoiceNumber: INV-2026-001
                    amount: 1500.00
                    customerName: Acme Corp
      responses:
        '200':
          description: PDF generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConversionResult'
        '400':
          description: Invalid template or data
        '401':
          description: Unauthorized - invalid or missing API key
  /data/currency/convert:
    post:
      operationId: convertCurrency
      summary: ApyHub - Convert Currency
      description: Converts an amount from one currency to another using current exchange rates
      tags:
        - Currency
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  description: Amount to convert
                source:
                  type: string
                  description: Source currency code (e.g., USD)
                target:
                  type: string
                  description: Target currency code (e.g., EUR)
            examples:
              CurrencyConvertExample:
                x-microcks-default: true
                summary: Example currency conversion request
                value:
                  amount: 100.00
                  source: USD
                  target: EUR
      responses:
        '200':
          description: Currency conversion result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CurrencyConversionResult'
              examples:
                CurrencyResultExample:
                  x-microcks-default: true
                  summary: Example currency conversion result
                  value:
                    amount: 100.00
                    source: USD
                    target: EUR
                    convertedAmount: 92.45
                    rate: 0.9245
        '400':
          description: Invalid currency codes or amount
        '401':
          description: Unauthorized - invalid or missing API key
  /extract/text/pdf:
    post:
      operationId: extractTextFromPdf
      summary: ApyHub - Extract Text from PDF
      description: Extracts text content from a PDF document
      tags:
        - Extract
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                url:
                  type: string
                  description: URL of the PDF file to extract text from
            examples:
              ExtractTextExample:
                x-microcks-default: true
                summary: Example text extraction request
                value:
                  url: https://example.com/document.pdf
      responses:
        '200':
          description: Text extracted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  text:
                    type: string
                    description: Extracted text content
                  pages:
                    type: integer
                    description: Number of pages in the PDF
              examples:
                ExtractResultExample:
                  x-microcks-default: true
                  summary: Example text extraction result
                  value:
                    text: This is the extracted text from the PDF document...
                    pages: 5
        '400':
          description: Invalid PDF URL or file
        '401':
          description: Unauthorized - invalid or missing API key
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apy-token
  schemas:
    ConversionResult:
      title: ConversionResult
      description: Result of a document conversion operation
      type: object
      properties:
        requestId:
          type: string
          description: Unique request identifier
        status:
          type: string
          enum: [pending, processing, completed, failed]
          description: Conversion status
        outputUrl:
          type: string
          description: URL of the converted output file
        error:
          type: string
          description: Error message if the conversion failed
    CurrencyConversionResult:
      title: CurrencyConversionResult
      description: Result of a currency conversion operation
      type: object
      properties:
        amount:
          type: number
          description: Original amount
        source:
          type: string
          description: Source currency code
        target:
          type: string
          description: Target currency code
        convertedAmount:
          type: number
          description: Converted amount in target currency
        rate:
          type: number
          description: Exchange rate used for the conversion