API Documentation
Access People Also Ask data programmatically with the JustPAA API.
Authentication
All API requests require an API key. You can find your API key in your account settings (Pro or Lifetime plan required).
Include your API key in the request header:
x-api-key: your_api_key_hereBase URL
https://www.justpaa.com/apiEndpoints
GET /alsoask
Retrieve People Also Ask questions for a search query.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Yes | The search query |
hl | string | Yes | Language code (e.g., "en", "es", "de", "fr") |
gl | string | Yes | Country code (e.g., "us", "uk", "de", "fr") |
city | string | No | City name for localized results (e.g., "London", "New York") |
Example Request
curl "https://www.justpaa.com/api/alsoask?q=what%20is%20seo&hl=en&gl=us" \
-H "x-api-key: sk_your_api_key_here"Example Response
{
"cached": false,
"searchesLeft": 149,
"payAsYouGoCreditsLeft": 0,
"renewalDate": "2026-01-15",
"result": {
"question": "what is seo",
"related": [
"What is seo and how does it work",
"What is SEO in digital marketing",
"Types of SEO"
],
"children": [
{
"question": "What is SEO and how does it work?",
"answer": "SEO stands for Search Engine Optimization...",
"url": "https://example.com/seo-guide",
"title": "Complete SEO Guide",
"children": [
{
"question": "What are the 4 types of SEO?",
"answer": "The four types of SEO are on-page, off-page, technical, and local SEO.",
"url": "https://example.com/seo-types",
"title": "Understanding SEO Types"
}
]
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
cached | boolean | Whether the result was served from cache |
searchesLeft | number | Remaining searches in your current billing period |
renewalDate | string | Date when your search quota resets |
result.question | string | The original search query |
result.related | array | Related search suggestions |
result.children | array | Array of PAA questions with nested sub-questions |
Question Object
| Field | Type | Description |
|---|---|---|
question | string | The PAA question |
answer | string | The featured snippet answer (if available) |
url | string | Source URL for the answer |
title | string | Title of the source page |
children | array | Nested sub-questions (recursive structure) |
Code Examples
Python
import requests
API_KEY = "sk_your_api_key_here"
BASE_URL = "https://www.justpaa.com/api"
def get_paa_questions(query, language="en", country="us"):
response = requests.get(
f"{BASE_URL}/alsoask",
headers={"x-api-key": API_KEY},
params={"q": query, "hl": language, "gl": country}
)
return response.json()
# Example usage
result = get_paa_questions("what is seo")
for child in result["result"]["children"]:
print(f"Q: {child['question']}")
print(f"A: {child['answer'][:100]}...")
print()JavaScript (Node.js)
const API_KEY = "sk_your_api_key_here";
const BASE_URL = "https://www.justpaa.com/api";
async function getPAAQuestions(query, language = "en", country = "us") {
const params = new URLSearchParams({ q: query, hl: language, gl: country });
const response = await fetch(`${BASE_URL}/alsoask?${params}`, {
headers: { "x-api-key": API_KEY }
});
return response.json();
}
// Example usage
getPAAQuestions("what is seo").then(result => {
result.result.children.forEach(child => {
console.log(`Q: ${child.question}`);
console.log(`A: ${child.answer?.substring(0, 100)}...`);
console.log();
});
});PHP
<?php
$apiKey = "sk_your_api_key_here";
$baseUrl = "https://www.justpaa.com/api";
function getPAAQuestions($query, $language = "en", $country = "us") {
global $apiKey, $baseUrl;
$params = http_build_query([
"q" => $query,
"hl" => $language,
"gl" => $country
]);
$ch = curl_init("$baseUrl/alsoask?$params");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-api-key: $apiKey"]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// Example usage
$result = getPAAQuestions("what is seo");
foreach ($result["result"]["children"] as $child) {
echo "Q: " . $child["question"] . "\n";
echo "A: " . substr($child["answer"], 0, 100) . "...\n\n";
}
?>Error Responses
| Status Code | Error | Description |
|---|---|---|
| 401 | Invalid token | The API key is missing or invalid |
| 403 | Invalid API Key | The API key doesn't exist or is inactive |
| 429 | Rate limit exceeded | You've exceeded your monthly search quota |
| 500 | Internal server error | Something went wrong on our end |
Need Help?
If you have questions about the API or need assistance, please contact us.