Overview
Integrate the Quotes API into your applications with ease. This API offers high performance, reliability, and comprehensive documentation to get you started quickly.
Documentation
Base URL
https://devapi.autoplannerx.com/api/v1/quotes-api
Authentication
All requests require an API key. Include it in the request header:
X-API-Key: YOUR_API_KEY
Endpoints
/random
Get a random quote
Returns a random inspirational quote.
curl -X GET "https://devapi.autoplannerx.com/api/v1/quotes-api/random" \
-H "X-API-Key: YOUR_API_KEY"
Example Response:
{
"quote": "The only way to do great work is to love what you do.",
"author": "Steve Jobs",
"category": "motivational"
}
/category/{category}
Get quotes by category
Returns a random quote from the specified category. Available categories: motivational, success, wisdom, life, technology.
curl -X GET "https://devapi.autoplannerx.com/api/v1/quotes-api/category/motivational" \
-H "X-API-Key: YOUR_API_KEY"
Example Response:
{
"quote": "Success is not final, failure is not fatal...",
"author": "Winston Churchill",
"category": "motivational"
}
/author/{author}
Get quotes by author
Returns a random quote from the specified author.
curl -X GET "https://devapi.autoplannerx.com/api/v1/quotes-api/author/albert-einstein" \
-H "X-API-Key: YOUR_API_KEY"
Code Examples
fetch('https://devapi.autoplannerx.com/api/v1/quotes-api/random', {
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
})
.then(response => response.json())
.then(data => {
console.log(data.quote);
console.log(data.author);
});
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://devapi.autoplannerx.com/api/v1/quotes-api/random');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-Key: YOUR_API_KEY'
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
echo $data['quote'] . ' - ' . $data['author'];
curl_close($ch);
import requests
headers = {'X-API-Key': 'YOUR_API_KEY'}
response = requests.get('https://devapi.autoplannerx.com/api/v1/quotes-api/random', headers=headers)
data = response.json()
print(f"{data['quote']} - {data['author']}")
Rate Limits
- Free Tier: 100 requests per hour
- Premium Tier: 1,000 requests per hour
- Enterprise Tier: 10,000 requests per hour
Error Responses
// 401 Unauthorized
{
"error": true,
"message": "API Key is missing"
}
// 429 Too Many Requests
{
"error": true,
"message": "Rate limit exceeded"
}
// 404 Not Found
{
"error": true,
"message": "API not found"
}
Code Examples
Get started quickly with code examples in your preferred programming language. All examples use the base URL: https://devapi.autoplannerx.com/api/v1/quotes-api
PHP Examples
Get Random Quote (cURL)
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://devapi.autoplannerx.com/api/v1/quotes-api/random");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-API-Key: YOUR_API_KEY"
]);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
$data = json_decode($response, true);
echo $data['quote'] . " - " . $data['author'];
} else {
echo "Error: " . $response;
}
?>
Get Quote by Category
<?php
$category = "motivational";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://devapi.autoplannerx.com/api/v1/quotes-api/category/" . urlencode($category));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-API-Key: YOUR_API_KEY"
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
echo $data['quote'];
?>
Using Guzzle HTTP Client
<?php
require_once "vendor/autoload.php";
use GuzzleHttp\Client;
$client = new Client();
$response = $client->get("https://devapi.autoplannerx.com/api/v1/quotes-api/random", [
"headers" => [
"X-API-Key" => "YOUR_API_KEY"
]
]);
$data = json_decode($response->getBody(), true);
echo $data['quote'] . " - " . $data['author'];
?>
JavaScript Examples
Fetch API (Browser)
// Get Random Quote
fetch("https://devapi.autoplannerx.com/api/v1/quotes-api/random", {
method: "GET",
headers: {
"X-API-Key": "YOUR_API_KEY"
}
})
.then(response => response.json())
.then(data => {
console.log(data.quote);
console.log(data.author);
document.getElementById("quote").textContent = data.quote;
})
.catch(error => {
console.error("Error:", error);
});
Get Quote by Category
const category = "motivational";
fetch(`https://devapi.autoplannerx.com/api/v1/quotes-api/category/${category}`, {
method: "GET",
headers: {
"X-API-Key": "YOUR_API_KEY"
}
})
.then(response => response.json())
.then(data => {
console.log(data);
});
Node.js (axios)
const axios = require("axios");
axios.get("https://devapi.autoplannerx.com/api/v1/quotes-api/random", {
headers: {
"X-API-Key": "YOUR_API_KEY"
}
})
.then(response => {
console.log(response.data.quote);
console.log(response.data.author);
})
.catch(error => {
console.error("Error:", error.response?.data || error.message);
});
Node.js (Native fetch)
// Node.js 18+ (native fetch)
fetch("https://devapi.autoplannerx.com/api/v1/quotes-api/random", {
method: "GET",
headers: {
"X-API-Key": "YOUR_API_KEY"
}
})
.then(response => response.json())
.then(data => {
console.log(data.quote);
})
.catch(error => {
console.error("Error:", error);
});
Python Examples
Using requests library
import requests
url = "https://devapi.autoplannerx.com/api/v1/quotes-api/random"
headers = {
"X-API-Key": "YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()
print(f"{data['quote']} - {data['author']}")
else:
print(f"Error: {response.status_code}")
print(response.text)
Get Quote by Category
import requests
category = "motivational"
url = f"https://devapi.autoplannerx.com/api/v1/quotes-api/category/{category}"
headers = {
"X-API-Key": "YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
data = response.json()
print(data['quote'])
Error Handling
import requests
from requests.exceptions import RequestException
url = "https://devapi.autoplannerx.com/api/v1/quotes-api/random"
headers = {
"X-API-Key": "YOUR_API_KEY"
}
try:
response = requests.get(url, headers=headers)
response.raise_for_status() # Raises an HTTPError for bad responses
data = response.json()
print(f"Quote: {data['quote']}")
print(f"Author: {data['author']}")
except RequestException as e:
print(f"Request failed: {e}")
except ValueError as e:
print(f"Invalid JSON response: {e}")
Using urllib (Standard Library)
import urllib.request
import urllib.parse
import json
url = "https://devapi.autoplannerx.com/api/v1/quotes-api/random"
headers = {
"X-API-Key": "YOUR_API_KEY"
}
req = urllib.request.Request(url, headers=headers)
with urllib.request.urlopen(req) as response:
data = json.loads(response.read().decode())
print(f"{data['quote']} - {data['author']}")