Skip to main content

Overview

Queries define the search terms you want to monitor across AI platforms. Each query represents a specific phrase or question that AI assistants might receive from users.

Query Properties

PropertyTypeDescription
idstring (UUID)Unique identifier
querystringThe search term or question
languagestringISO 639-1 language code
countrystringISO 3166-1 alpha-2 country code
projectstring (UUID)Parent project ID
tagsnumber[]Associated tag IDs

Creating Queries

Single Query

curl -X POST "https://api.mentionlab.io/api/queries" \
  -H "x-api-key: ml_live_abc123xyz789..." \
  -H "x-organisation-id: YOUR_ORG_ID" \
  -H "x-project-id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "best project management software 2024",
    "language": "en",
    "country": "US",
    "tagIds": [1, 2]
  }'
{
  "id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
  "project": "01234567-89ab-cdef-0123-456789abcdef",
  "query": "best project management software 2024",
  "language": "en",
  "country": "US",
  "tags": [1, 2],
  "updatedAt": "2024-01-15T10:30:00.000Z"
}

Multiple Queries

Create many queries at once for efficiency:
curl -X POST "https://api.mentionlab.io/api/queries/many" \
  -H "x-api-key: ml_live_abc123xyz789..." \
  -H "x-organisation-id: YOUR_ORG_ID" \
  -H "x-project-id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "queries": [
      {
        "query": "best CRM software",
        "language": "en",
        "country": "US"
      },
      {
        "query": "top sales tools",
        "language": "en",
        "country": "US"
      },
      {
        "query": "meilleur logiciel CRM",
        "language": "fr",
        "country": "FR"
      }
    ]
  }'

Listing Queries

Retrieve queries with filtering and pagination:
curl -X POST "https://api.mentionlab.io/api/queries/list?limit=50&page=0" \
  -H "x-api-key: ml_live_abc123xyz789..." \
  -H "x-organisation-id: YOUR_ORG_ID" \
  -H "x-project-id: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json"

Language and Country Codes

Language Codes

Language codes follow the ISO 639-1 standard, using two-letter lowercase codes (e.g., en for English, fr for French, de for German).

Country Codes

Country codes follow the ISO 3166-1 alpha-2 standard, using two-letter uppercase codes (e.g., US for United States, GB for United Kingdom, FR for France).
Using the correct language and country codes helps target the right audience and improves result accuracy. AI responses can vary significantly based on locale.

Query Best Practices

Specific queries yield more relevant results:✅ “best enterprise CRM software for sales teams 2024”❌ “CRM”
Frame queries as users would ask AI assistants:✅ “What are the best alternatives to Salesforce?”❌ “salesforce alternatives list”
Add relevant context to your queries:✅ “best project management tools for remote teams”❌ “project management tools”
Create multiple queries for different phrasings:
  • “best CRM software”
  • “top CRM tools”
  • “which CRM should I use”
  • “CRM recommendations”

Next Steps