List the project's queries
curl --request GET \
--url https://api.mentionlab.io/api/v2/projects/{projectId}/queries \
--header 'x-project-id: <x-project-id>'import requests
url = "https://api.mentionlab.io/api/v2/projects/{projectId}/queries"
headers = {"x-project-id": "<x-project-id>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-project-id': '<x-project-id>'}};
fetch('https://api.mentionlab.io/api/v2/projects/{projectId}/queries', 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.mentionlab.io/api/v2/projects/{projectId}/queries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-project-id: <x-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mentionlab.io/api/v2/projects/{projectId}/queries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-project-id", "<x-project-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mentionlab.io/api/v2/projects/{projectId}/queries")
.header("x-project-id", "<x-project-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/v2/projects/{projectId}/queries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-project-id"] = '<x-project-id>'
response = http.request(request)
puts response.read_body{
"page": {
"totalRecords": 123,
"limit": 123,
"currentPage": 123,
"totalPages": 123,
"nextPage": 123,
"prevPage": 123
},
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"query": "best running shoes",
"language": "en",
"country": "US",
"type": "comparative",
"tags": [
{
"id": 12,
"name": "Branded",
"color": "#3b82f6"
}
],
"recurrenceSetting": {
"id": "018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42",
"name": "Weekly"
},
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Queries
List the project's queries
Sorted by text, A to Z, unless sort says otherwise.
GET
/
api
/
v2
/
projects
/
{projectId}
/
queries
List the project's queries
curl --request GET \
--url https://api.mentionlab.io/api/v2/projects/{projectId}/queries \
--header 'x-project-id: <x-project-id>'import requests
url = "https://api.mentionlab.io/api/v2/projects/{projectId}/queries"
headers = {"x-project-id": "<x-project-id>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-project-id': '<x-project-id>'}};
fetch('https://api.mentionlab.io/api/v2/projects/{projectId}/queries', 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.mentionlab.io/api/v2/projects/{projectId}/queries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-project-id: <x-project-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mentionlab.io/api/v2/projects/{projectId}/queries"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-project-id", "<x-project-id>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mentionlab.io/api/v2/projects/{projectId}/queries")
.header("x-project-id", "<x-project-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/v2/projects/{projectId}/queries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-project-id"] = '<x-project-id>'
response = http.request(request)
puts response.read_body{
"page": {
"totalRecords": 123,
"limit": 123,
"currentPage": 123,
"totalPages": 123,
"nextPage": 123,
"prevPage": 123
},
"results": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"query": "best running shoes",
"language": "en",
"country": "US",
"type": "comparative",
"tags": [
{
"id": 12,
"name": "Branded",
"color": "#3b82f6"
}
],
"recurrenceSetting": {
"id": "018f3a2b-7c4d-7e91-b3f5-2a6c8d0e1f42",
"name": "Weekly"
},
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Query Parameters
Queries of any of these types; an untyped query matches none
The type of question the query asks: "comparative" (compares options), "informative" (seeks facts or how-to information) or "perception" (probes opinions about a brand).
Available options:
comparative, informative, perception