Everything you need to integrate with ApiNest. Simple, powerful, and reliable APIs for your applications with comprehensive examples and error handling.
Get up and running with ApiNest in under 5 minutes
Sign up for free and generate your first API key in the dashboard. No credit card required.
Create API KeyTest the API with a simple request. Copy and paste the example below.
curl -H "x-api-key: YOUR_KEY" \ https://sky-pix.xyz/api/v1/joke
Use our SDKs and examples to integrate into your application. Monitor usage in real-time.
View SDKsSecure API access with industry-standard authentication
All API requests require authentication using your API key in the request header. Include your API key in every request:
# Required header for all requests x-api-key: your_api_key_here # Alternative: Query parameter (not recommended for production) ?api_key=your_api_key_here
Keep Keys Secure
Never expose API keys in client-side code or public repositories
Use Environment Variables
Store keys in environment variables or secure configuration
Rotate Keys Regularly
Generate new keys periodically and deactivate old ones
Complete reference for all available APIs with examples and parameters
/api/v1/meme
1 pointReturns a random XKCD comic with title, image URL, alt text, and publication metadata.
curl -H "x-api-key: YOUR_KEY" \ https://sky-pix.xyz/api/v1/meme
{ "title": "Compiling", "img": "https://imgs.xkcd.com/comics/compiling.png", "alt": "Are you compiling? 'My code's compiling.' https://xkcd.com/303/", "num": 303, "day": "28", "month": "9", "year": "2007", "link": "", "news": "", "safe_title": "Compiling", "transcript": "", "permalink": "https://xkcd.com/303/" }
title
- Comic titleimg
- Direct image URLalt
- Alt text/tooltipnum
- Comic numberday/month/year
- Publication datepermalink
- XKCD URL/api/v1/dad-joke
1 pointReturns a random dad joke with safe, family-friendly humor and metadata.
curl -H "x-api-key: YOUR_KEY" \ https://sky-pix.xyz/api/v1/dad-joke
{ "joke": "Why don't scientists trust atoms? Because they make up everything!", "id": 1, "category": "dad", "type": "single", "safe": true, "lang": "en", "timestamp": "2024-01-15T10:30:00.000Z" }
joke
- The dad joke textid
- Unique joke identifiercategory
- Always "dad"type
- Always "single"safe
- Always true (family-friendly)timestamp
- Response timestamp/api/v1/would-you-rather
1 pointReturns a random "Would You Rather" question with two choices for games and icebreakers.
curl -H "x-api-key: YOUR_KEY" \ https://sky-pix.xyz/api/v1/would-you-rather
{ "question": "Would you rather have the ability to fly or be invisible?", "optionA": "Have the ability to fly", "optionB": "Be invisible", "id": 1, "category": "superpowers", "difficulty": "easy", "timestamp": "2024-01-15T10:30:00.000Z" }
question
- Full question textoptionA
- First choice optionoptionB
- Second choice optionid
- Unique question identifiercategory
- Question categorydifficulty
- Question difficulty level/api/v1/joke
1 pointReturns a random family-friendly joke with category and safety information.
curl -H "x-api-key: YOUR_KEY" \ https://sky-pix.xyz/api/v1/joke
{ "joke": "Why don't scientists trust atoms? Because they make up everything!", "category": "science", "safe": true, "id": 12345, "type": "single" }
joke
- The joke textcategory
- Joke category (science, programming, etc.)safe
- Boolean indicating family-friendly contentid
- Unique joke identifier/api/v1/advice
1 pointReturns a random piece of helpful life advice with categorization.
curl -H "x-api-key: YOUR_KEY" \ https://sky-pix.xyz/api/v1/advice
{ "advice": "Take time to make your soul happy.", "id": 42, "category": "wellness", "author": "anonymous" }
/api/v1/fact
2 pointsReturns a random interesting fact with verification status and source information.
curl -H "x-api-key: YOUR_KEY" \ https://apinest.com/api/v1/fact
{ "fact": "Octopuses have three hearts and blue blood.", "category": "animals", "verified": true, "source": "marine_biology", "tags": ["ocean", "biology", "animals"] }
Complete guide to API errors, status codes, and troubleshooting
ApiNest uses conventional HTTP response codes to indicate the success or failure of an API request. All errors include detailed messages and error codes for easy debugging.
{ "error": "MISSING_API_KEY", "message": "API key is required" }
Solution: Include your API key in the x-api-key
header
{ "error": "INVALID_API_KEY", "message": "Invalid or inactive API key" }
Solution: Check your API key is correct and active in the dashboard
{ "error": "RATE_LIMIT_MINUTE", "message": "Rate limit exceeded. Try again in a minute.", "retryAfter": 60 }
Solution: Wait for the specified time or upgrade your plan
{ "error": "RATE_LIMIT_DAY", "message": "Daily rate limit exceeded. Try again tomorrow.", "retryAfter": 86400 }
Solution: Wait until tomorrow or upgrade to a higher plan
{ "error": "INSUFFICIENT_POINTS", "message": "Insufficient points. Required: 5, Available: 2", "required": 5, "available": 2, "plan": "free" }
Solution: Upgrade your plan or wait for monthly reset
{ "error": "PREMIUM_REQUIRED", "message": "This API requires a premium subscription.", "requiredPlan": "premium", "currentPlan": "free" }
Solution: Upgrade to premium plan to access this API
{ "error": "API_NOT_FOUND", "message": "API endpoint not found" }
Solution: Check the API endpoint URL and version
{ "error": "API_OFFLINE", "message": "API is temporarily offline for maintenance", "api": "ai-image", "version": 1 }
Solution: Check our status page or try again later
if (response.status !== 200) { const error = await response.json(); console.error('API Error:', error.message); // Handle specific error types switch(error.error) { case 'INSUFFICIENT_POINTS': // Show upgrade prompt break; case 'RATE_LIMIT_MINUTE': // Implement retry logic break; } }
async function apiCall(url, options, retries = 3) { for (let i = 0; i < retries; i++) { try { const response = await fetch(url, options); if (response.status === 429) { const delay = Math.pow(2, i) * 1000; await new Promise(r => setTimeout(r, delay)); continue; } return response; } catch (error) { if (i === retries - 1) throw error; } } }
Transparent pricing with generous free tier and flexible scaling
Perfect for getting started
For serious developers
Different APIs consume different amounts of points based on computational complexity and resource usage:
Ready-to-use code examples in popular programming languages
While you can use any HTTP client, here are comprehensive examples in popular languages with error handling and best practices:
// Basic API call with error handling async function callApiNest(endpoint, apiKey) { try { const response = await fetch(`https://apinest.com/api/v1/${endpoint}`, { headers: { 'x-api-key': apiKey, 'Content-Type': 'application/json' } }); if (!response.ok) { const error = await response.json(); throw new Error(`API Error: ${error.message}`); } return await response.json(); } catch (error) { console.error('ApiNest Error:', error.message); throw error; } } // Usage examples const apiKey = process.env.APINEST_API_KEY; // Get a joke const joke = await callApiNest('joke', apiKey); console.log(joke.joke); // Generate AI text const aiText = await callApiNest('ai-text?q=Write a haiku about coding', apiKey); console.log(aiText.text); // Get Pokemon data const pokemon = await callApiNest('pokemon?name=pikachu', apiKey); console.log(`${pokemon.name} is a ${pokemon.types.join('/')} type Pokemon`);
const axios = require('axios'); // Create an axios instance with default config const apiNest = axios.create({ baseURL: 'https://apinest.com/api/v1', headers: { 'x-api-key': process.env.APINEST_API_KEY }, timeout: 30000 // 30 second timeout }); // Add response interceptor for error handling apiNest.interceptors.response.use( response => response.data, error => { if (error.response) { console.error('API Error:', error.response.data.message); throw new Error(error.response.data.message); } throw error; } ); // Usage examples try { const joke = await apiNest.get('/joke'); console.log(joke.joke); const advice = await apiNest.get('/advice'); console.log(advice.advice); const translation = await apiNest.get('/ai-translate', { params: { q: 'Hello world', target: 'es' } }); console.log(translation.translated); } catch (error) { console.error('Failed to call API:', error.message); }
Get help and stay updated with ApiNest
Comprehensive guides, tutorials, and API references
Join our community for help, tips, and discussions
Real-time API status and incident reports
Get priority support, faster response times, and dedicated assistance with our Premium plan.