Get the paid ads of a search
curl --request POST \
--url https://api.aisa.one/v1/tasks/ads.get_search_ads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"engine": "bing",
"query": "<string>",
"country": "US",
"device": "desktop",
"limit": 20
}
}
'import requests
url = "https://api.aisa.one/v1/tasks/ads.get_search_ads"
payload = { "input": {
"engine": "bing",
"query": "<string>",
"country": "US",
"device": "desktop",
"limit": 20
} }
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({
input: {engine: 'bing', query: '<string>', country: 'US', device: 'desktop', limit: 20}
})
};
fetch('https://api.aisa.one/v1/tasks/ads.get_search_ads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/v1/tasks/ads.get_search_ads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'engine' => 'bing',
'query' => '<string>',
'country' => 'US',
'device' => 'desktop',
'limit' => 20
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/v1/tasks/ads.get_search_ads"
payload := strings.NewReader("{\n \"input\": {\n \"engine\": \"bing\",\n \"query\": \"<string>\",\n \"country\": \"US\",\n \"device\": \"desktop\",\n \"limit\": 20\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/v1/tasks/ads.get_search_ads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"engine\": \"bing\",\n \"query\": \"<string>\",\n \"country\": \"US\",\n \"device\": \"desktop\",\n \"limit\": 20\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/v1/tasks/ads.get_search_ads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"engine\": \"bing\",\n \"query\": \"<string>\",\n \"country\": \"US\",\n \"device\": \"desktop\",\n \"limit\": 20\n }\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"approximate_fields": [
"<string>"
],
"delivered": true,
"missing_fields": {}
},
"result": {
"items": [
{
"advertiser_domain": "<string>",
"description": "<string>",
"displayed_link": "<string>",
"engine": "bing",
"landing_url": "<string>",
"placement": "top",
"position": 123,
"query": "<string>",
"sitelinks": [
{
"description": "<string>",
"link": "<string>",
"title": "<string>"
}
],
"title": "<string>",
"extras": {}
}
]
},
"status": "found",
"task": "ads.get_search_ads",
"version": 1
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"retry_hint": "never",
"retryable": true,
"param": "<string>",
"problems": [
"<string>"
],
"similar_tasks": [
"<string>"
],
"task_id": "<string>"
}
}Ads
Get the paid ads of a search
Use when you need the text ads a search engine shows for a query in a country: headline, description, display URL, landing page, advertiser domain and sitelinks, in page order.
POST
https://api.aisa.one
/
v1
/
tasks
/
ads.get_search_ads
Get the paid ads of a search
curl --request POST \
--url https://api.aisa.one/v1/tasks/ads.get_search_ads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"input": {
"engine": "bing",
"query": "<string>",
"country": "US",
"device": "desktop",
"limit": 20
}
}
'import requests
url = "https://api.aisa.one/v1/tasks/ads.get_search_ads"
payload = { "input": {
"engine": "bing",
"query": "<string>",
"country": "US",
"device": "desktop",
"limit": 20
} }
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({
input: {engine: 'bing', query: '<string>', country: 'US', device: 'desktop', limit: 20}
})
};
fetch('https://api.aisa.one/v1/tasks/ads.get_search_ads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/v1/tasks/ads.get_search_ads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'input' => [
'engine' => 'bing',
'query' => '<string>',
'country' => 'US',
'device' => 'desktop',
'limit' => 20
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/v1/tasks/ads.get_search_ads"
payload := strings.NewReader("{\n \"input\": {\n \"engine\": \"bing\",\n \"query\": \"<string>\",\n \"country\": \"US\",\n \"device\": \"desktop\",\n \"limit\": 20\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/v1/tasks/ads.get_search_ads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"input\": {\n \"engine\": \"bing\",\n \"query\": \"<string>\",\n \"country\": \"US\",\n \"device\": \"desktop\",\n \"limit\": 20\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/v1/tasks/ads.get_search_ads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": {\n \"engine\": \"bing\",\n \"query\": \"<string>\",\n \"country\": \"US\",\n \"device\": \"desktop\",\n \"limit\": 20\n }\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"approximate_fields": [
"<string>"
],
"delivered": true,
"missing_fields": {}
},
"result": {
"items": [
{
"advertiser_domain": "<string>",
"description": "<string>",
"displayed_link": "<string>",
"engine": "bing",
"landing_url": "<string>",
"placement": "top",
"position": 123,
"query": "<string>",
"sitelinks": [
{
"description": "<string>",
"link": "<string>",
"title": "<string>"
}
],
"title": "<string>",
"extras": {}
}
]
},
"status": "found",
"task": "ads.get_search_ads",
"version": 1
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"request_id": "<string>",
"retry_hint": "never",
"retryable": true,
"param": "<string>",
"problems": [
"<string>"
],
"similar_tasks": [
"<string>"
],
"task_id": "<string>"
}
}The request and response panels use the schemas published by this API. Conditional requirements and allowed combinations are part of the request schema. Check the complete schema before combining filters or identities.
Successful delivery is charged; a normal empty result is not charged.
Obtain an input-specific quote by sending the same request with
Billing
| Input | Price unit | Price (USD) |
|---|---|---|
| All valid inputs | Per successful request | 0.0007 |
X-AISA-Cost-Mode: quote; quoting neither executes the Task nor reserves funds. Execution reserves the estimated request charge and settles under the rules above. Use X-AISA-Max-Price-USD to cap the price.
Use an Idempotency-Key when executing a Task. For errors, inspect error.code, error.request_id, error.retryable and error.retry_hint. A reconciliation hint requires checking the existing request before retrying; do not assume a pending settlement is a refund.