Skip to content

API Reference

Base URL

For self-hosted deployments purchased through Magic Meal Kits, the base URL will depend on your deployment configuration:

https://magic-meal-kits-xxxxx.run.app/api/v1

Authentication

All API endpoints require authentication using an API key. Include your API key in the X-API-KEY header of your requests.

curl -X GET "https://magic-meal-kits-xxxxx.run.app/api/v1/endpoint" \
     -H "X-API-KEY: your-api-key"

Available Endpoints

The API is organized into the following categories:

  • PDF Processing: Endpoints for processing and manipulating PDF files (URL-based)
  • JavaScript Execution: Endpoints for executing pure JavaScript code
  • YouTube API: Endpoints for retrieving YouTube video transcripts and metadata
  • Notion API: Endpoints for interacting with Notion workspaces and content
  • Proxy Image API: Endpoints for proxying Google Drive images for Notion

PDF Processing API

The PDF Processing API provides endpoints for extracting information from PDF files, converting PDFs to different formats, and manipulating PDF documents. Key features include:

  • Extracting metadata from PDF files via URL
  • Converting PDF to text, HTML, or Markdown
  • Extracting images from PDF files
  • Splitting PDF files into individual pages

JavaScript Execution API

The JavaScript Execution API provides an endpoint for executing pure JavaScript code securely in a sandboxed environment. Key features include:

  • Executing standard JavaScript code with timeout controls
  • Console output capture
  • Returning execution results in JSON format

YouTube API

The YouTube API provides endpoints for retrieving transcripts, video metadata, and identifying video types from YouTube videos. Key features include:

  • Retrieving video transcripts in multiple formats
  • Getting video metadata
  • Identifying whether a video is a regular video or a short

Notion API

The Notion API provides endpoints for interacting with Notion workspaces and content. Key features include:

  • Converting between Markdown and Notion blocks formats
  • Duplicating content within Notion workspaces
  • Managing user access to Notion pages
  • Inviting and revoking user access to Notion content

Proxy Image API

The Proxy Image API provides endpoints for proxying Google Drive images for Notion. Key features include:

  • Google Drive Integration: Easily embed Google Drive images in Notion pages
  • Image Optimization: Resize and optimize images for Notion
  • Caching: Improve loading times with server-side caching

Error Handling

All API endpoints return a standard error format:

{
  "success": false,
  "error": "Error message description"
}

Common error codes:

  • 400 Bad Request: Invalid parameters or request body
  • 401 Unauthorized: Missing or invalid API key
  • 404 Not Found: Resource not found
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Internal Server Error: Server-side error

Rate Limiting

API endpoints have rate limiting applied to ensure fair usage. If you exceed the rate limit, you will receive a 429 Too Many Requests response.