Create a task
curl --request POST \
--url https://api.apiforgeo.com/v1/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "best running shoes for flat feet",
"model": "chatgpt",
"country": "US",
"language": "en",
"enrichments": [
"<string>"
],
"webhookUrl": "<string>",
"metadata": {
"campaign": "q4"
}
}
'import requests
url = "https://api.apiforgeo.com/v1/tasks"
payload = {
"prompt": "best running shoes for flat feet",
"model": "chatgpt",
"country": "US",
"language": "en",
"enrichments": ["<string>"],
"webhookUrl": "<string>",
"metadata": { "campaign": "q4" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'best running shoes for flat feet',
model: 'chatgpt',
country: 'US',
language: 'en',
enrichments: ['<string>'],
webhookUrl: '<string>',
metadata: {campaign: 'q4'}
})
};
fetch('https://api.apiforgeo.com/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"status": "queued",
"mode": "live",
"prompt": "<string>",
"model": "<string>",
"country": "<string>",
"language": "<string>",
"enrichments": [
"<string>"
],
"metadata": {},
"webhookUrl": "<string>",
"costMicros": 123,
"refunded": true,
"apiKeyId": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"failedAt": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"resultExpiresAt": "<string>",
"result": {
"answer": "<string>",
"entities": [
{
"name": "<string>",
"type": "brand",
"position": 123,
"mentions": 123,
"sentiment": 0.8,
"stance": "chosen"
}
],
"sources": [
{
"url": "<string>",
"domain": "<string>",
"title": "<string>",
"position": 123
}
],
"fanOuts": [
{
"phrase": "best running shoes for flat feet 2026"
}
],
"products": [
{
"name": "<string>",
"brand": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
},
"rating": 123,
"reviewCount": 123,
"imageUrl": "<string>",
"position": 123,
"merchants": [
{
"name": "<string>",
"url": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
}
}
]
}
],
"ads": [
{
"position": 123,
"format": "<string>",
"advertiser": "<string>",
"brand": "<string>",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>",
"url": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
},
"strikethroughPrice": {
"amountMicros": 123,
"currency": "<string>"
},
"rating": 123
}
]
}
}{
"id": "<string>",
"status": "queued",
"mode": "live",
"prompt": "<string>",
"model": "<string>",
"country": "<string>",
"language": "<string>",
"enrichments": [
"<string>"
],
"metadata": {},
"webhookUrl": "<string>",
"costMicros": 123,
"refunded": true,
"apiKeyId": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"failedAt": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"resultExpiresAt": "<string>",
"result": {
"answer": "<string>",
"entities": [
{
"name": "<string>",
"type": "brand",
"position": 123,
"mentions": 123,
"sentiment": 0.8,
"stance": "chosen"
}
],
"sources": [
{
"url": "<string>",
"domain": "<string>",
"title": "<string>",
"position": 123
}
],
"fanOuts": [
{
"phrase": "best running shoes for flat feet 2026"
}
],
"products": [
{
"name": "<string>",
"brand": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
},
"rating": 123,
"reviewCount": 123,
"imageUrl": "<string>",
"position": 123,
"merchants": [
{
"name": "<string>",
"url": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
}
}
]
}
],
"ads": [
{
"position": 123,
"format": "<string>",
"advertiser": "<string>",
"brand": "<string>",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>",
"url": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
},
"strikethroughPrice": {
"amountMicros": 123,
"currency": "<string>"
},
"rating": 123
}
]
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}Tasks
Create a task
Checks the model, the country and the language, the key budget and the balance, charges the task and queues it. Poll GET /v1/tasks/, or pass webhookUrl. Send an Idempotency-Key to retry safely: the same key returns the first task, charged once.
POST
/
v1
/
tasks
Create a task
curl --request POST \
--url https://api.apiforgeo.com/v1/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "best running shoes for flat feet",
"model": "chatgpt",
"country": "US",
"language": "en",
"enrichments": [
"<string>"
],
"webhookUrl": "<string>",
"metadata": {
"campaign": "q4"
}
}
'import requests
url = "https://api.apiforgeo.com/v1/tasks"
payload = {
"prompt": "best running shoes for flat feet",
"model": "chatgpt",
"country": "US",
"language": "en",
"enrichments": ["<string>"],
"webhookUrl": "<string>",
"metadata": { "campaign": "q4" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
prompt: 'best running shoes for flat feet',
model: 'chatgpt',
country: 'US',
language: 'en',
enrichments: ['<string>'],
webhookUrl: '<string>',
metadata: {campaign: 'q4'}
})
};
fetch('https://api.apiforgeo.com/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"status": "queued",
"mode": "live",
"prompt": "<string>",
"model": "<string>",
"country": "<string>",
"language": "<string>",
"enrichments": [
"<string>"
],
"metadata": {},
"webhookUrl": "<string>",
"costMicros": 123,
"refunded": true,
"apiKeyId": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"failedAt": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"resultExpiresAt": "<string>",
"result": {
"answer": "<string>",
"entities": [
{
"name": "<string>",
"type": "brand",
"position": 123,
"mentions": 123,
"sentiment": 0.8,
"stance": "chosen"
}
],
"sources": [
{
"url": "<string>",
"domain": "<string>",
"title": "<string>",
"position": 123
}
],
"fanOuts": [
{
"phrase": "best running shoes for flat feet 2026"
}
],
"products": [
{
"name": "<string>",
"brand": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
},
"rating": 123,
"reviewCount": 123,
"imageUrl": "<string>",
"position": 123,
"merchants": [
{
"name": "<string>",
"url": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
}
}
]
}
],
"ads": [
{
"position": 123,
"format": "<string>",
"advertiser": "<string>",
"brand": "<string>",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>",
"url": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
},
"strikethroughPrice": {
"amountMicros": 123,
"currency": "<string>"
},
"rating": 123
}
]
}
}{
"id": "<string>",
"status": "queued",
"mode": "live",
"prompt": "<string>",
"model": "<string>",
"country": "<string>",
"language": "<string>",
"enrichments": [
"<string>"
],
"metadata": {},
"webhookUrl": "<string>",
"costMicros": 123,
"refunded": true,
"apiKeyId": "<string>",
"createdAt": "<string>",
"startedAt": "<string>",
"completedAt": "<string>",
"failedAt": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"resultExpiresAt": "<string>",
"result": {
"answer": "<string>",
"entities": [
{
"name": "<string>",
"type": "brand",
"position": 123,
"mentions": 123,
"sentiment": 0.8,
"stance": "chosen"
}
],
"sources": [
{
"url": "<string>",
"domain": "<string>",
"title": "<string>",
"position": 123
}
],
"fanOuts": [
{
"phrase": "best running shoes for flat feet 2026"
}
],
"products": [
{
"name": "<string>",
"brand": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
},
"rating": 123,
"reviewCount": 123,
"imageUrl": "<string>",
"position": 123,
"merchants": [
{
"name": "<string>",
"url": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
}
}
]
}
],
"ads": [
{
"position": 123,
"format": "<string>",
"advertiser": "<string>",
"brand": "<string>",
"title": "<string>",
"body": "<string>",
"imageUrl": "<string>",
"url": "<string>",
"price": {
"amountMicros": 123,
"currency": "<string>"
},
"strikethroughPrice": {
"amountMicros": 123,
"currency": "<string>"
},
"rating": 123
}
]
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}{
"error": {
"code": "insufficient_balance",
"message": "<string>",
"details": {},
"requestId": "<string>"
}
}Authorizations
Body
application/json
Response
Replayed: the task of this Idempotency-Key