Skip to content

Latest commit

Β 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

🌐 Multi-language API Docs Viewer

This project provides a lightweight, interactive HTML-based interface to view API request examples in multiple programming languages (JSON, Node.js, Python, PHP, Java, Ruby). It dynamically converts a single JSON request object into language-specific request formats on the fly.

##πŸš€ Features

βœ… Centralized JSON request data πŸ”„ Dynamic conversion into multiple languages using JavaScript 🌈 Syntax highlighting with highlight.js πŸ–±οΈ Language dropdown to switch between JSON, Node.js, Python, PHP, Java, Ruby πŸ“œ Includes a sample static API response block

πŸ“Έ Preview

πŸ“ File Structure

. β”œβ”€β”€ index.html # Main interactive HTML page β”œβ”€β”€ README.md # Project documentation (you’re here)

##πŸ§ͺ Sample JSON Request The JSON payload represents a comprehensive KYC onboarding API example, including nested structures like Prospect, Address, Phone, Identification Document, etc. πŸ’‘ How It Works

A JavaScript function jsonToCode(lang, payload) takes the language and base JSON, and returns the correctly formatted code snippet. Highlight.js is used for code block formatting and syntax highlighting. Language dropdown triggers onChange events to rerender the code in real-time.

🌐 Supported Languages

JSON Node.js (Axios) Python (Requests) PHP (Stream Context) Java (HttpClient) Ruby (Net::HTTP)

πŸ“¦ Usage

Just open the index.html file in your browser β€” no backend or build step required.

Clone and run

git clone https://github.com/your-username/multi-lang-api-docs.git cd multi-lang-api-docs open index.html

πŸ› οΈ Tech Stack

HTML, CSS, JavaScript highlight.js

✨ Future Improvements

Add support for more languages (Go, C#, etc.) Code copy buttons Live API tester (e.g., with Fetch) Toggle request/response structure separately

About

This project provides a lightweight, interactive HTML-based interface to view API request examples in multiple programming languages (JSON, Node.js, Python, PHP, Java, Ruby). It dynamically converts a single JSON request object into language-specific request formats on the fly.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages