Usage Guide
How to integrate PRINCE API into your app — in any language
Quick Start — 3 steps
1
Get an API Key
Contact Prince Tech via WhatsApp or the Contact page to request a free API key. Keys are usually issued within a few minutes.
2
Pick an Endpoint
Browse the AI, Tools, Downloader, or any other category in the sidebar. Each page lists the endpoint name, required params, and a live Test button.
3
Make Your First Request
Append ?apikey=YOUR_KEY and your params to the base URL. The API always returns JSON. See the code examples below for copy-paste starters in your language.
Base URL & Authentication
All requests start from this base URL:
loading…
Pass your API key as a query parameter named apikey on every request. Example: /api/ai/ai?apikey=YOUR_KEY&q=Hello. Never expose your key in public client-side code — use a backend proxy.
All endpoints use GET requests with query parameters unless otherwise noted in the endpoint documentation. Responses are always JSON (except buffer/image endpoints which return raw file data).
URL Pattern
https://prince-api.replit.app/api/{category}/{endpoint}?apikey=YOUR_KEY¶m1=val&…
| Part | Example | Notes |
|---|---|---|
| category | ai · download · anime · search · stalk · tools · tempmail | Matches the sidebar section |
| endpoint | ai · ytmp3 · search · ig | See each category page for all endpoints |
| apikey | YOUR_KEY | Required on every call |
Code Examples
# AI Chat endpoint — replace YOUR_KEY with your actual key
curl -X GET "https://prince-api.replit.app/api/ai/ai?apikey=YOUR_KEY&q=Hello"
# Downloader endpoint
curl -X GET "https://prince-api.replit.app/api/download/ytmp3?apikey=YOUR_KEY&url=https://youtu.be/dQw4w9WgXcQ"
# Anime search
curl -X GET "https://prince-api.replit.app/api/anime/search?apikey=YOUR_KEY&q=naruto"
// ── JavaScript (Browser / Fetch API) ──────────────────────
const apiKey = 'YOUR_KEY';
const baseUrl = 'https://prince-api.replit.app';
// AI Chat
async function chatWithAI(question) {
const params = new URLSearchParams({ apikey: apiKey, q: question });
const res = await fetch(`${baseUrl}/api/ai/ai?${params}`);
const data = await res.json();
console.log(data);
}
chatWithAI('What is JavaScript?');
// YouTube Downloader
async function downloadYouTube(videoUrl) {
const params = new URLSearchParams({ apikey: apiKey, url: videoUrl });
const res = await fetch(`${baseUrl}/api/download/ytmp3?${params}`);
const data = await res.json();
console.log(data.url); // direct download link
}
downloadYouTube('https://youtu.be/dQw4w9WgXcQ');
// ── Node.js (using axios) ──────────────────────────────────
// npm install axios
const axios = require('axios');
const API_KEY = 'YOUR_KEY';
const BASE = 'https://prince-api.replit.app';
// Helper — wraps every call
async function prince(path, params = {}) {
const { data } = await axios.get(`${BASE}/${path}`, {
params: { apikey: API_KEY, ...params }
});
return data;
}
// AI chat
prince('api/ai/ai', { q: 'Explain async/await' })
.then(res => console.log(res.response));
// Anime search
prince('api/anime/search', { q: 'one piece' })
.then(res => console.log(res.results));
// TikTok downloader
prince('api/download/tiktok', { url: 'https://vm.tiktok.com/...' })
.then(res => console.log(res.video));
# ── Python (requests) ──────────────────────────────────────
# pip install requests
import requests
API_KEY = "YOUR_KEY"
BASE = "https://prince-api.replit.app"
def prince(path, **params):
params["apikey"] = API_KEY
r = requests.get(f"{BASE}/{path}", params=params)
r.raise_for_status()
return r.json()
# AI chat
result = prince("api/ai/ai", q="What is Python?")
print(result["response"])
# Instagram stalker
info = prince("api/stalk/ig", username="cristiano")
print(info["followers"])
# URL Shortener
short = prince("api/tools/shorten", url="https://example.com")
print(short["short_url"])
// ── PHP (cURL) ──────────────────────────────────────────────
<?php
define('API_KEY', 'YOUR_KEY');
define('BASE_URL', 'https://prince-api.replit.app');
// Helper function
function prince($path, array $params = []) {
$params['apikey'] = API_KEY;
$url = BASE_URL . '/' . $path . '?' . http_build_query($params);
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
curl_close($ch);
return json_decode($body, true);
}
// AI chat
$ai = prince('api/ai/ai', ['q' => 'Hello from PHP!']);
echo $ai['response'];
// YouTube MP3
$mp3 = prince('api/download/ytmp3', ['url' => 'https://youtu.be/dQw4w9WgXcQ']);
echo $mp3['url'];
?>
Response Format
Successful responses always include a status: 200 field. The data field varies per endpoint but is always valid JSON.
Success
{
"status": 200,
"creator": "PRINCE APIs",
"response": "Hello! I'm Prince AI, how can I help you today?"
}
Error
{
"status": 403,
"error": "Invalid or missing API key"
}
Error Codes
| HTTP Code | Meaning | How to Fix |
|---|---|---|
| 200 | OK — request succeeded | All good. Parse the JSON response. |
| 400 | Bad Request — missing or invalid param | Check that all required parameters are included and correctly formatted. |
| 401 | Unauthorized — API key not recognised | Verify your apikey value. Request a new key if needed. |
| 403 | Forbidden — key expired or limit reached | Your plan limit may be exhausted. Contact Prince Tech to renew. |
| 429 | Too Many Requests — rate limit hit | Add exponential back-off and retry after a short delay. |
| 500 | Server Error — upstream issue | Retry after a few seconds. If persistent, report via contact page. |
Plans & Rate Limits
| Plan | Daily Limit | Reset | Price |
|---|---|---|---|
| Free | Limited requests | Daily | Free |
| Daily | Higher cap | Every 24 h | Contact for pricing |
| Weekly | Extended cap | Weekly | Contact for pricing |
| Monthly | High cap | Monthly | Contact for pricing |
| Lifetime | Unlimited | — | Contact for pricing |
To upgrade your plan or check your current usage, message Prince Tech on WhatsApp Channel or use the Contact page. Include your username or API key for faster processing.
Tips & Best Practices
Protect your API key
Never hard-code your key in front-end JavaScript that gets shipped to browsers. Use environment variables on your server and proxy calls through a backend endpoint.
Never hard-code your key in front-end JavaScript that gets shipped to browsers. Use environment variables on your server and proxy calls through a backend endpoint.
Retry on 5xx errors
Upstream services occasionally blip. Implement a simple retry with exponential back-off — wait 1 s, then 2 s, then 4 s before giving up.
Upstream services occasionally blip. Implement a simple retry with exponential back-off — wait 1 s, then 2 s, then 4 s before giving up.
Use the Test button first
Every endpoint page has a Test button that fires the real API directly in your browser. Use it to explore responses before writing a single line of code.
Every endpoint page has a Test button that fires the real API directly in your browser. Use it to explore responses before writing a single line of code.
Set a timeout
AI and downloader endpoints can take a few seconds. Always set a request timeout (e.g. 30 s) in your HTTP client to avoid your app hanging on slow responses.
AI and downloader endpoints can take a few seconds. Always set a request timeout (e.g. 30 s) in your HTTP client to avoid your app hanging on slow responses.
© 2024–2025 PRINCE Tech · All rights reserved