Documentation
Welcome to the API_HUB Docs. Our APIs are designed to be RESTful, returning JSON-encoded responses with standard HTTP codes. Whether you are building a simple portfolio or a complex React application, our mock endpoints will save you hours of backend development.
Base API URL
https://api.api-hub.com/v1Quick Start Guide
Connect to any endpoint using standard fetch or axios. No complex headers required for the Free Tier.
// Example: Fetching Products
const fetchData = async () => {
const res = await fetch('https://api.api-hub.com/v1/ecommerce/products');
const data = await res.json();
console.log(data);
}
const fetchData = async () => {
const res = await fetch('https://api.api-hub.com/v1/ecommerce/products');
const data = await res.json();
console.log(data);
}
Authentication
For Premium and Enterprise tiers, include your API key in the request headers.
Headers: { "x-api-key": "YOUR_SECRET_KEY" }
E-commerce Endpoints
MethodEndpointDescription
GET/productsGet list of all items
GET/products/:idGet single item detail
POST/cartSimulate adding to cart