CGHEVEN API Reference
Official developer guide for accessing CGHEVEN's content programmatically. Fetch Assets and Categories directly from your applications.
RESTful APIBearer Token AuthJSON Format
Base URL
https://api.cgheven.com/apiAuthentication
All endpoints require Bearer Token authentication
Authorization Header
Include this header in all requests
Authorization: Bearer YOUR_API_TOKENInvalid Token Response
What you'll receive if token is missing/invalid
{
"error": "Forbidden",
"message": "Invalid authorization header"
}Available Endpoints
Complete list of API resources
| Resource | Method | Endpoint | Description |
|---|---|---|---|
| Assets | GET | /assets | Get all assets |
| Categories | GET | /categories | Get all categories |
Pagination
Handle large datasets efficiently
Pagination Parameters
By default, Strapi returns 25 items per request
Example: Fetch 100 items from page 1
GET /assets?pagination[page]=1&pagination[pageSize]=100JavaScript Example: Fetch All Pages
async function fetchAllAssets() {
let all = [];
let page = 1;
let pageSize = 100;
while (true) {
const res = await fetch(
`https://api.cgheven.com/api/assets?populate=*&pagination[page]=${page}&pagination[pageSize]=${pageSize}`,
{ headers: { Authorization: `Bearer YOUR_TOKEN` } }
);
const json = await res.json();
all = all.concat(json.data);
const total = json.meta.pagination.total;
if (page * pageSize >= total) break;
page++;
}
console.log("✅ Total assets fetched:", all.length);
return all;
}Common Asset Fields
Understanding the data structure
| Field | Type | Description |
|---|---|---|
| Title | String | Asset name/title |
| thumbnail | String (URL) | Thumbnail image |
| previews | String (URL) | Preview video |
| files[] | Array | Download links |
| Info_JSON | Object | Metadata like creation date, version, and flags |
| categorie | Object | Linked category |
| is_patreon_locked | Boolean | Shows if the asset requires Patreon access |
| createdAt | DateTime | When the asset was created |
| updatedAt | DateTime | Last updated timestamp |
Code Examples
Quick start in different environments
JavaScript (Browser)
fetch('https://api.cgheven.com/api/assets?populate=*', {
headers: {
Authorization: 'Bearer YOUR_API_TOKEN'
}
})
.then(res => res.json())
.then(data => console.log(data));Node.js (Axios)
import axios from "axios";
const API_URL = "https://api.cgheven.com/api/assets";
const TOKEN = "YOUR_API_TOKEN";
axios.get(API_URL, {
headers: {
Authorization: `Bearer ${TOKEN}`
}
})
.then(res => console.log(res.data))
.catch(err => console.error(err));Error Handling
Common HTTP status codes and their meanings
401
Unauthorized
Missing or invalid token
404
Not Found
Invalid endpoint or ID
429
Rate Limited
Too many requests
500
Server Error
Strapi internal error
Performance Tips & Best Practices
- Use
pagination[pageSize]wisely (100 recommended) - Avoid fetching all collections at once in production
- Use
fields[]to request only specific attributes - Cache API responses (e.g., in localStorage or your database)
Need Help?
Contact our support team for API assistance