Getting Started with AllBeAPI

Welcome to AllBeAPI! This guide will get you up and running in just a few minutes. Learn how to make your first API call and integrate AllBeAPI into your project.

⏱️
5 minutes
to get started
📦
2 SDKs
JavaScript & Python
🎯
13+
integrated libraries

What is AllBeAPI?

AllBeAPI is a universal SDK that provides a unified interface to access popular third-party libraries through simple API calls. Instead of managing multiple dependencies and learning different APIs, you can use one consistent interface for all your needs.

🎯

One Interface, Many Libraries

Access Markdown processing, QR code generation, code formatting, image manipulation, and more through a single API.

Easy Integration

Get started in minutes with our JavaScript and Python SDKs, or use the REST API directly from any language.

🌍

Open Source

Completely open source with MIT license. Self-host, contribute, or use our public API for free.

Quick Start

The fastest way to try AllBeAPI is with a simple API call. Choose your preferred method below:

Try in Browser (30 seconds)

Copy and paste this into an HTML file and open it in your browser:

<!DOCTYPE html>
<html>
<head>
    <title>AllBeAPI Demo</title>
</head>
<body>
    <h1>AllBeAPI Demo</h1>
    <textarea id="markdown" placeholder="Enter markdown..."># Hello AllBeAPI
This is **awesome**!</textarea>
    <button onclick="convert()">Convert to HTML</button>
    <div id="result"></div>

    <script src="https://cdn.jsdelivr.net/gh/TingjiaInFuture/allbeapi@3/SDK/JavaScript/allbeapi.js"></script>
    <script>
        const api = new AllBeApi();
        
        async function convert() {
            const markdown = document.getElementById('markdown').value;
            const result = document.getElementById('result');
            
            try {
                const response = await api.marked.render(markdown);
                result.innerHTML = '<h3>Result:</h3>' + response;
            } catch (error) {
                result.innerHTML = '<p style="color: red;">Error: ' + error.message + '</p>';
            }
        }
    </script>
</body>
</html>

Node.js Setup

Create a new Node.js project and try AllBeAPI:

# Create new project
mkdir allbeapi-demo
cd allbeapi-demo
npm init -y

# Download the SDK
curl -O https://raw.githubusercontent.com/TingjiaInFuture/allbeapi/main/SDK/JavaScript/allbeapi.js

Create demo.js:

const AllBeApi = require('./allbeapi.js');

async function demo() {
    const api = new AllBeApi();
    
    try {
        // Convert Markdown to HTML
        const html = await api.marked.render('# Hello AllBeAPI\nThis is **awesome**!');
        console.log('HTML:', html);
        
        // Generate QR Code
        const qrBlob = await api.pythonQrcode.generateQrcode('https://allbeapi.com');
        console.log('QR Code generated, size:', qrBlob.size, 'bytes');
        
    } catch (error) {
        console.error('Error:', error.message);
    }
}

demo();

Run the demo:

node demo.js

Python Setup

Download and try the Python SDK:

# Download the SDK
curl -O https://raw.githubusercontent.com/TingjiaInFuture/allbeapi/main/SDK/Python/allbeapi.py

Create demo.py:

from allbeapi import AllBeApi

def main():
    api = AllBeApi()
    
    try:
        # Convert Markdown to HTML
        html = api.marked.render('# Hello AllBeAPI\nThis is **awesome**!')
        print('HTML:', html)
        
        # Generate QR Code
        qr_bytes = api.python_qrcode.generate_qrcode('https://allbeapi.com')
        with open('demo_qr.png', 'wb') as f:
            f.write(qr_bytes)
        print('QR Code saved as demo_qr.png')
        
    except Exception as error:
        print('Error:', error)

if __name__ == '__main__':
    main()

Run the demo:

python demo.py

Direct API Calls

Test AllBeAPI directly with cURL:

# Convert Markdown to HTML
curl -X POST https://res.allbeapi.top/marked/render \
  -H "Content-Type: application/json" \
  -d '{"markdown": "# Hello AllBeAPI\nThis is **awesome**!"}'

# Generate QR Code
curl -X POST https://res.allbeapi.top/python-qrcode/generate-qrcode \
  -H "Content-Type: application/json" \
  -d '{"data": "https://allbeapi.com"}' \
  --output demo_qr.png

# Format JavaScript code
curl -X POST https://res.allbeapi.top/prettier/format \
  -H "Content-Type: application/json" \
  -d '{"code": "const x=1;console.log(x);", "parser": "babel"}'

Installation Options

Choose the installation method that works best for your project:

🌐

Browser (CDN)

Include directly in your HTML for instant access:

<script src="https://cdn.jsdelivr.net/gh/TingjiaInFuture/allbeapi@3/SDK/JavaScript/allbeapi.js"></script>
Pros: No build step, instant setup, cached by CDN
📦

JavaScript SDK

Download and include in your JavaScript projects:

# Download JavaScript SDK
curl -O https://raw.githubusercontent.com/TingjiaInFuture/allbeapi/main/SDK/JavaScript/allbeapi.js

# Or use wget
wget https://raw.githubusercontent.com/TingjiaInFuture/allbeapi/main/SDK/JavaScript/allbeapi.js
// Include in your project
const { AllBeApi } = require('./allbeapi.js');
Pros: Simple setup, no package manager required
🐍

Python SDK

Download and include in your Python projects:

# Download Python SDK
curl -O https://raw.githubusercontent.com/TingjiaInFuture/allbeapi/main/SDK/Python/allbeapi.py

# Or use wget
wget https://raw.githubusercontent.com/TingjiaInFuture/allbeapi/main/SDK/Python/allbeapi.py
from allbeapi import AllBeApi
Pros: Simple setup, no package manager required
📁

Direct Download

Download SDK files directly for maximum control:

# Download JavaScript SDK
curl -O https://raw.githubusercontent.com/TingjiaInFuture/allbeapi/main/SDK/JavaScript/allbeapi.js

# Download Python SDK
curl -O https://raw.githubusercontent.com/TingjiaInFuture/allbeapi/main/SDK/Python/allbeapi.py
Pros: No external dependencies, full control, works offline

Your First API Request

Let's walk through making your first API request step by step:

1

Initialize the Client

Create an instance of the AllBeAPI client:

const api = new AllBeApi();
// You can also specify a custom endpoint:
// const api = new AllBeApi('https://your-custom-endpoint.com');
from allbeapi import AllBeApi

api = AllBeApi()
# You can also specify a custom endpoint:
# api = AllBeApi('https://your-custom-endpoint.com')
2

Make Your First Call

Let's convert some Markdown to HTML:

const markdown = `
# Welcome to AllBeAPI
This is your **first** API call!

## Features
- Easy to use
- Powerful
- Open source
`;

try {
    const html = await api.marked.render(markdown);
    console.log('Success!', html);
} catch (error) {
    console.error('Error:', error.message);
}
markdown = """
# Welcome to AllBeAPI
This is your **first** API call!

## Features
- Easy to use
- Powerful
- Open source
"""

try:
    html = api.marked.render(markdown)
    print('Success!', html)
except Exception as error:
    print('Error:', error)
3

Handle the Response

AllBeAPI returns structured responses:

{
  "success": true,
  "data": {
    "html": "<h1>Welcome to AllBeAPI</h1>\n<p>This is your <strong>first</strong> API call!</p>\n<h2>Features</h2>\n<ul>\n<li>Easy to use</li>\n<li>Powerful</li>\n<li>Open source</li>\n</ul>"
  },
  "metadata": {
    "processing_time": 0.045,
    "library_version": "[email protected]"
  }
}

Common Use Cases

Here are some common scenarios and how to implement them with AllBeAPI:

📝

Blog Content Processing

Convert markdown blog posts to HTML and generate social sharing QR codes:

async function processBlogPost(markdown, postUrl) {
    // Convert markdown to HTML
    const html = await api.marked.render(markdown);
    
    // Generate QR code for sharing
    const qrBlob = await api.pythonQrcode.generateQrcode(postUrl);
    
    // Sanitize HTML for safety
    const cleanHtml = await api.sanitizeHtml.clean(html, {
        allowedTags: ['h1', 'h2', 'h3', 'p', 'strong', 'em', 'ul', 'li'],
        allowedAttributes: {}
    });
    
    return { html: cleanHtml, qrCode: qrBlob };
}
🔧

Code Processing Pipeline

Format, lint, and highlight code in one pipeline:

def process_code(code, language='javascript'):
    # Format the code
    formatted = api.prettier.format(code, parser='babel')
    
    # Lint for errors
    lint_result = api.eslint.analyze(formatted)
    
    # Add syntax highlighting
    highlighted = api.pygments.highlight(formatted, language)
    
    return {
        'formatted': formatted,
        'lint_errors': lint_result.get('errors', []),
        'highlighted': highlighted
    }
📊

Data Validation & Processing

Validate JSON data and process CSV files:

async function validateAndProcess(jsonData, csvData, schema) {
    // Validate JSON against schema
    const validation = await api.ajv.validate(schema, jsonData);
    
    if (!validation.valid) {
        throw new Error('Data validation failed');
    }
    
    // Parse CSV data
    const parsedCsv = await api.csvParser.parse(csvData);
    
    return {
        validatedData: jsonData,
        csvRecords: parsedCsv
    };
}

Next Steps

Now that you've made your first API call, here's what to explore next:

📚

Explore All APIs

Discover all 13+ integrated libraries and their capabilities.

API Reference
🛠️

SDK Deep Dive

Learn advanced SDK features, error handling, and best practices.

SDK Guide
💡

See Examples

Browse real-world examples and integration patterns.

Examples
🤝

Join Community

Get help, share ideas, and contribute to the project.

GitHub

Getting Help

Need help or have questions? Here are the best ways to get support:

📖

Documentation

Comprehensive guides and API reference

Browse Docs
💬

GitHub Discussions

Ask questions and discuss with the community

Join Discussion
🐛

Issue Tracker

Report bugs or request new features

Report Issue
💡

Examples Repository

Browse code examples and use cases

View Examples

Ready to Build Something Amazing?

You now have everything you need to start using AllBeAPI in your projects!