Skip to content
Console(opens in a new tab)

Ask a question in plain English

Send a question in plain English, and the API writes and runs the search for you.

Prompt search answers a question written in plain English. Put the question inline in searchInput.prompt and leave out the selection set (the { ... on Brand { ... } } block that usually follows search(...)). Enigma’s prompt search writes a GraphQL query for the question, the API runs that query, and the results come back under data.search.

The generated query sets the entity type, the filters, and the fields to return, so the shape of the results depends on the question. When prompt is set, the other SearchInput fields, such as entityType, conditions, and output, are ignored. The generated query is billed like any other search.

Ask about a specific business by its name or website, for example:

  • “Give me a company profile for chipotle.com.”
  • “Find the Shake Shack (shakeshack.com) locations in Boston, MA with their addresses and phone numbers.”
Request
query {
search(searchInput: { prompt: "Give me a company profile for chipotle.com." })
}
Response
{
"data": {
"search": [
{
"id": "825ce859-b742-49cb-9787-b9b32f674f25",
"names": {
"edges": [
{
"node": {
"name": "CHIPOTLE MEXICAN GRILL"
}
}
]
},
"websites": {
"edges": [
{
"node": {
"website": "https://www.chipotle.com",
"domain": "chipotle",
"firstObservedDate": "2013-05-01 15:36:40+00",
"lastObservedDate": "2026-10-05 01:50:31+00"
}
}
]
},
"industries": {
"edges": [
{
"node": {
"industryDesc": "Full-Service Restaurants",
"industryCode": "722511",
"industryType": "naics_2022_code"
}
},
{
"node": {
"industryDesc": "mexican restaurant",
"industryCode": null,
"industryType": "enigma_industry_description"
}
}
]
},
"isMarketables": {
"edges": [
{
"node": {
"isMarketable": true
}
}
]
},
"hqAddress": {
"edges": [
{
"node": {
"addresses": {
"edges": [
{
"node": {
"fullAddress": "610 NEWPORT CENTER DR STE 1100 NEWPORT BEACH CA 92660",
"city": "NEWPORT BEACH",
"state": "CA",
"zip": "92660"
}
}
]
}
}
}
]
}
}
]
}
}
Request Result
prompt with a selection set HTTP 400 with the error 'prompt' cannot be combined with a selection set
prompt passed in a GraphQL variable HTTP 400, or HTTP 200 with an empty list when the whole searchInput is a variable
prompt in an aggregate query HTTP 400 with the error 'prompt' is not supported for aggregate queries
A question that lists businesses by category, such as “List all the coffee shops in Austin, Texas.” HTTP 400 with an error saying that category discovery is not supported
A question that asks for a count, such as “How many coffee shops are in Austin, Texas?” HTTP 400. Write an aggregate query instead, or ask the question through the Python SDK, which answers count questions.

When prompt search cannot turn a question into a query, the API returns HTTP 400 with the reason in errors. If prompt search does not answer within 30 seconds, the API returns HTTP 504 with the error Prompt processing timed out. If prompt search is busy, the API returns HTTP 429 or 529; retry after a short wait.

The Enigma Python SDK, enigma-api-client, sends your question to the same prompt search with your API key, receives the generated query, and runs it against the API. It requires Python 3.11 or later.

Terminal window
pip install enigma-api-client
import asyncio
from enigma_api_client import Client, ClientConfig
async def main():
async with Client(ClientConfig(enigma_api_key="YOUR_API_KEY")) as client:
response = await client.search(prompt="Give me a company profile for chipotle.com.")
print(response.status_code, response.data)
asyncio.run(main())

To see the generated query and its variables without running them, call ServiceStrategy.generate_query:

import asyncio
from enigma_api_client.strategies import ServiceStrategy
async def main():
strategy = ServiceStrategy(enigma_api_key="YOUR_API_KEY")
try:
generated = await strategy.generate_query("Give me a company profile for chipotle.com.")
print(generated.query)
print(generated.variables)
finally:
await strategy.aclose()
asyncio.run(main())

The Python SDK guide covers the other ways the SDK turns a question into a query.