curl --request GET \
--url https://api.mentionlab.io/api/queries/{id} \
--header 'x-project-id: <x-project-id>'import requests
url = "https://api.mentionlab.io/api/queries/{id}"
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/queries/{id}', 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/queries/{id}",
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/queries/{id}"
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/queries/{id}")
.header("x-project-id", "<x-project-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/queries/{id}")
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{
"id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"project": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"tags": [
1,
2,
3
],
"query": "mentionlab",
"language": "en",
"country": "US",
"updatedAt": "2023-08-22T10:00:00.000Z",
"type": "comparative",
"recurrenceSetting": {
"id": "018f3a2b-7c4d-7e1a-9b2c-3d4e5f6a7b8c",
"name": "Daily core queries"
}
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Get a query by ID
Returns a single query with its tags by UUID; a query belonging to another project is treated as not found.
curl --request GET \
--url https://api.mentionlab.io/api/queries/{id} \
--header 'x-project-id: <x-project-id>'import requests
url = "https://api.mentionlab.io/api/queries/{id}"
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/queries/{id}', 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/queries/{id}",
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/queries/{id}"
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/queries/{id}")
.header("x-project-id", "<x-project-id>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mentionlab.io/api/queries/{id}")
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{
"id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"project": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
"tags": [
1,
2,
3
],
"query": "mentionlab",
"language": "en",
"country": "US",
"updatedAt": "2023-08-22T10:00:00.000Z",
"type": "comparative",
"recurrenceSetting": {
"id": "018f3a2b-7c4d-7e1a-9b2c-3d4e5f6a7b8c",
"name": "Daily core queries"
}
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}{
"statusCode": 400,
"message": "Validation failed",
"error": "Bad Request"
}Headers
Project ID to specify the project context
Path Parameters
The UUID of the query to retrieve.
Response
Unique identifier (UUID) of the query.
"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
The project this query belongs to
"a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6"
The tags IDs this query belongs to
[1, 2, 3]
The search query text tracked for this entry.
"mentionlab"
ISO 639-1 language code used to scope the query results.
"en"
ISO 3166-1 alpha-2 country code used to scope the query results.
"US"
Timestamp of the last time the query was updated.
"2023-08-22T10:00:00.000Z"
The type of question the query asks. Null for queries that have not been classified.
comparative, informative, perception The recurrence setting this query is linked to, or null when the query does not recur.
Show child attributes
Show child attributes