curl --request POST \
--url http://localhost:8000/api/v1/market-analysis/analyses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"google_ads_customer_id": 123,
"summary": "<string>",
"do_include_assistant_knowledge_item": false,
"config": {
"services": [
"<string>"
],
"location_ids": [
123
],
"language_id": 1000,
"website_url": "<string>"
}
}
'import requests
url = "http://localhost:8000/api/v1/market-analysis/analyses"
payload = {
"title": "<string>",
"google_ads_customer_id": 123,
"summary": "<string>",
"do_include_assistant_knowledge_item": False,
"config": {
"services": ["<string>"],
"location_ids": [123],
"language_id": 1000,
"website_url": "<string>"
}
}
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({
title: '<string>',
google_ads_customer_id: 123,
summary: '<string>',
do_include_assistant_knowledge_item: false,
config: {
services: ['<string>'],
location_ids: [123],
language_id: 1000,
website_url: '<string>'
}
})
};
fetch('http://localhost:8000/api/v1/market-analysis/analyses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/market-analysis/analyses",
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([
'title' => '<string>',
'google_ads_customer_id' => 123,
'summary' => '<string>',
'do_include_assistant_knowledge_item' => false,
'config' => [
'services' => [
'<string>'
],
'location_ids' => [
123
],
'language_id' => 1000,
'website_url' => '<string>'
]
]),
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 := "http://localhost:8000/api/v1/market-analysis/analyses"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"google_ads_customer_id\": 123,\n \"summary\": \"<string>\",\n \"do_include_assistant_knowledge_item\": false,\n \"config\": {\n \"services\": [\n \"<string>\"\n ],\n \"location_ids\": [\n 123\n ],\n \"language_id\": 1000,\n \"website_url\": \"<string>\"\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("http://localhost:8000/api/v1/market-analysis/analyses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"google_ads_customer_id\": 123,\n \"summary\": \"<string>\",\n \"do_include_assistant_knowledge_item\": false,\n \"config\": {\n \"services\": [\n \"<string>\"\n ],\n \"location_ids\": [\n 123\n ],\n \"language_id\": 1000,\n \"website_url\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/market-analysis/analyses")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"google_ads_customer_id\": 123,\n \"summary\": \"<string>\",\n \"do_include_assistant_knowledge_item\": false,\n \"config\": {\n \"services\": [\n \"<string>\"\n ],\n \"location_ids\": [\n 123\n ],\n \"language_id\": 1000,\n \"website_url\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"title": "<string>",
"google_ads_customer_id": 123,
"id": 123,
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"summary": "<string>",
"do_include_assistant_knowledge_item": false,
"config": {
"services": [
"<string>"
],
"location_ids": [
123
],
"language_id": 1000,
"website_url": "<string>"
},
"created_campaign_id": 123,
"keywords": [
{
"id": 123,
"keyword_text": "<string>",
"is_selected": true,
"avg_monthly_searches": 123,
"competition": "<string>",
"competition_index": 123,
"low_bid": "<string>",
"high_bid": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create a new market analysis
Create a new market analysis session.
This creates a draft analysis that can be populated with keywords and eventually used to create a campaign.
curl --request POST \
--url http://localhost:8000/api/v1/market-analysis/analyses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"google_ads_customer_id": 123,
"summary": "<string>",
"do_include_assistant_knowledge_item": false,
"config": {
"services": [
"<string>"
],
"location_ids": [
123
],
"language_id": 1000,
"website_url": "<string>"
}
}
'import requests
url = "http://localhost:8000/api/v1/market-analysis/analyses"
payload = {
"title": "<string>",
"google_ads_customer_id": 123,
"summary": "<string>",
"do_include_assistant_knowledge_item": False,
"config": {
"services": ["<string>"],
"location_ids": [123],
"language_id": 1000,
"website_url": "<string>"
}
}
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({
title: '<string>',
google_ads_customer_id: 123,
summary: '<string>',
do_include_assistant_knowledge_item: false,
config: {
services: ['<string>'],
location_ids: [123],
language_id: 1000,
website_url: '<string>'
}
})
};
fetch('http://localhost:8000/api/v1/market-analysis/analyses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/market-analysis/analyses",
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([
'title' => '<string>',
'google_ads_customer_id' => 123,
'summary' => '<string>',
'do_include_assistant_knowledge_item' => false,
'config' => [
'services' => [
'<string>'
],
'location_ids' => [
123
],
'language_id' => 1000,
'website_url' => '<string>'
]
]),
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 := "http://localhost:8000/api/v1/market-analysis/analyses"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"google_ads_customer_id\": 123,\n \"summary\": \"<string>\",\n \"do_include_assistant_knowledge_item\": false,\n \"config\": {\n \"services\": [\n \"<string>\"\n ],\n \"location_ids\": [\n 123\n ],\n \"language_id\": 1000,\n \"website_url\": \"<string>\"\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("http://localhost:8000/api/v1/market-analysis/analyses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"google_ads_customer_id\": 123,\n \"summary\": \"<string>\",\n \"do_include_assistant_knowledge_item\": false,\n \"config\": {\n \"services\": [\n \"<string>\"\n ],\n \"location_ids\": [\n 123\n ],\n \"language_id\": 1000,\n \"website_url\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/market-analysis/analyses")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"google_ads_customer_id\": 123,\n \"summary\": \"<string>\",\n \"do_include_assistant_knowledge_item\": false,\n \"config\": {\n \"services\": [\n \"<string>\"\n ],\n \"location_ids\": [\n 123\n ],\n \"language_id\": 1000,\n \"website_url\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"title": "<string>",
"google_ads_customer_id": 123,
"id": 123,
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"summary": "<string>",
"do_include_assistant_knowledge_item": false,
"config": {
"services": [
"<string>"
],
"location_ids": [
123
],
"language_id": 1000,
"website_url": "<string>"
},
"created_campaign_id": 123,
"keywords": [
{
"id": 123,
"keyword_text": "<string>",
"is_selected": true,
"avg_monthly_searches": 123,
"competition": "<string>",
"competition_index": 123,
"low_bid": "<string>",
"high_bid": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Schema for creating a market analysis.
Analysis title
Google Ads customer ID
Summary/description of the market analysis
Whether to include assistant knowledge items for this analysis
Analysis configuration (can be empty on Market Analysis creation)
Show child attributes
Show child attributes
Response
Successful Response
Schema for a market analysis.
Analysis title
Google Ads customer ID
Analysis ID
Analysis status (draft, completed, campaign_created)
draft, completed, campaign_created Creation timestamp
Last update timestamp
Summary/description of the market analysis
Whether to include assistant knowledge items for this analysis
Analysis configuration (can be empty on Market Analysis creation)
Show child attributes
Show child attributes
ID of created campaign if any
Associated keywords
Show child attributes
Show child attributes