JSPM

@knowcode/convert-to-markdown

1.3.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 156
  • Score
    100M100P100Q83420F
  • License MIT

Convert Excel, PDF, and Word documents to clean, AI-ready formats like Markdown and JSON

Package Exports

  • @knowcode/convert-to-markdown
  • @knowcode/convert-to-markdown/excel
  • @knowcode/convert-to-markdown/pdf
  • @knowcode/convert-to-markdown/powerpoint
  • @knowcode/convert-to-markdown/utils
  • @knowcode/convert-to-markdown/word

Readme

Convert to Markdown

npm version npm downloads License: MIT API v2 Knowcode Organization

Convert Excel, PDF, and Word documents to clean, AI-ready formats with our secure API.

🚀 Production API Endpoint

https://convert-api-qpg64cvnga-uk.a.run.app

Secure API with Authentication • Usage Tracking • 50 Free Conversions/month

🎯 Key Features

  • 🔑 API Key Authentication - Secure access with usage tracking
  • 📊 Usage Analytics - Monitor your conversions and performance
  • 🎨 RESTful Design - Clean, intuitive /v1/convert/ endpoints
  • 🆓 Free Tier - 50 conversions/month to get started
  • ⚡ Fast Processing - Convert documents in seconds
  • 🔒 Zero Storage - Your files are never saved

🚀 Quick Start

1. Get Your API Key

Test API Keys Available:

  • Free Tier: test_a8baaf01a4124761b7467b918bc9c263 (50 conversions/month)
  • Pro Tier: pro_eb78f30408b647c6bcb90ccb9027c5f6 (10,000 conversions/month)

2. Make Your First Request

curl -X POST https://convert-api-qpg64cvnga-uk.a.run.app/v1/convert/pdf-to-markdown \
  -H "X-API-Key: test_a8baaf01a4124761b7467b918bc9c263" \
  -F "file=@yourfile.pdf"

3. Check Your Usage

curl https://convert-api-qpg64cvnga-uk.a.run.app/v1/usage/summary \
  -H "X-API-Key: test_a8baaf01a4124761b7467b918bc9c263"

📚 Documentation

🔄 Supported Conversions

From To Endpoint
Excel (.xlsx, .xls, .xlsm) JSON /v1/convert/excel-to-json
Excel (.xlsx, .xls, .xlsm) Markdown /v1/convert/excel-to-markdown
PDF Markdown /v1/convert/pdf-to-markdown
Word (.docx, .dotx, .dotm) HTML /v1/convert/word-to-html
Word (.docx, .dotx, .dotm) Markdown /v1/convert/word-to-markdown

💰 Pricing

Plan Price Conversions File Size Support
Free $0/month 50/month 5MB Community
Pro $10/month 10,000/month 10MB Priority
Enterprise Custom Unlimited Custom Dedicated

💻 CLI Installation

Install the command-line tool for local document conversion:

npm install -g @knowcode/convert-to-markdown

Quick usage:

# Convert Excel to Markdown
convert-to-markdown excel-to-markdown report.xlsx -o report.md

# Convert PDF to Markdown
convert-to-markdown pdf-to-markdown document.pdf -o document.md

# Show all examples
convert-to-markdown examples

See CLI Usage Guide for complete documentation.

🛠️ Integration Examples

JavaScript/Node.js

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

const response = await fetch('https://convert-to-markdown.knowcode.tech/v1/convert/excel-to-json', {
  method: 'POST',
  headers: {
    'X-API-Key': 'your-api-key'
  },
  body: formData
});

const result = await response.json();
console.log(result.content);

Python

import requests

with open('document.xlsx', 'rb') as f:
    response = requests.post(
        'https://convert-to-markdown.knowcode.tech/v1/convert/excel-to-json',
        headers={'X-API-Key': 'your-api-key'},
        files={'file': f}
    )
    
result = response.json()
print(result['content'])

Bubble.io

API Connector Setup:
- API Name: Convert to Markdown
- Authentication: Private key in header
- Key name: X-API-Key
- Key value: [your-api-key]
- Base URL: https://convert-to-markdown.knowcode.tech/v1

🔒 Security First

  • Zero-storage architecture - Your files are never saved
  • Memory-only processing - Data processed in RAM only
  • Instant deletion - Files purged after conversion
  • HTTPS encryption - Secure data transmission

Read more about our security →

📊 Usage Tracking

Monitor your API usage in real-time:

# Get current month summary
curl https://convert-to-markdown.knowcode.tech/v1/usage/summary \
  -H "X-API-Key: your-api-key"

# Get detailed history
curl https://convert-to-markdown.knowcode.tech/v1/usage/history \
  -H "X-API-Key: your-api-key"

# Check real-time usage
curl https://convert-to-markdown.knowcode.tech/v1/usage/current \
  -H "X-API-Key: your-api-key"

🚨 Error Handling

All errors follow a consistent format:

{
  "error": {
    "code": "USAGE_001",
    "message": "Monthly quota exceeded (50 conversions)",
    "details": {
      "used": 50,
      "limit": 50
    }
  },
  "help": "Upgrade to Pro plan for 10,000 monthly conversions",
  "documentation": "https://convert-to-markdown.knowcode.tech/docs/errors#USAGE_001"
}

📦 NPM Package

For self-hosted deployments:

npm install @knowcode/convert-to-markdown
const ConvertToMarkdown = require('@knowcode/convert-to-markdown');

// Use as a library (self-hosted)
const result = await ConvertToMarkdown.excelToJson('data.xlsx');
console.log(result.content);

NPM Package Documentation →

🚀 Deploy Your Own

Deploy as Google Cloud Functions:

# Clone the repository
git clone https://github.com/wapdat/convert-to-markdown.git
cd convert-to-markdown

# Deploy to Google Cloud
./deploy.sh

🤝 Contributing

We welcome contributions! Please see our Contributing Guide.

📄 License

MIT License - see LICENSE file.

🆘 Support


Built with ❤️ by Knowcode • Powered by Google Cloud Functions