Data Selections
POST/v1/query
Execute a query with the given projection ID and filters.
The below example demonstrates how to make a POST request to the query endpoint using Python's requests library. It includes setting up the payload with filters for searching "New York" and "Stock Market" in the text field.
The results will be all data points in your map with both the terms "New York" and "Stock Market" in the text
column.
See the capabilities section for a more detailed walkthrough.
import requests
import json
# Query endpoint
url = "https://api-atlas.nomic.ai/v1/query"
# Request payload
payload = {
"projection_id": "d50b79ea-910d-4975-9930-b5ce0736fbd0",
"selection": {
"method": "composition",
"conjunctor": "ALL",
"filters": [
{
"method": "search",
"query": "New York",
"field": "text",
},
{
"method": "search",
"query": "Stock Market",
"field": "text",
}
]
}
}
# Set the headers
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <Your API Key>"
}
# Send the POST request
response = requests.post(url, data=json.dumps(payload), headers=headers)
Request
- application/json
Body
required
Array [
- SearchSelection
- SemanticSearchSelection
- MOD1
- MOD2
Array [
]
]
selection
object
Possible values: [composition
]
Default value: true
Possible values: [ANY
, ALL
]
cherries
object
Default value: true
Possible values: [cherrypick
]
Possible values: >= 2
, <= 2
Default value: ``
Possible values: >= 2
, <= 2
Default value: ``
filters
object[]
oneOf
Default value: true
Possible values: [search
]
Default value: true
Default value: true
Possible values: [semanticSearch
]
Possible values: [dot
, l2
]
Default value: dot
embedding
object
required
oneOf
number
string
Possible values: >= 2
, <= 2
Possible values: [search_document
, search_query
]
Responses
- 200
- 400
- 401
Successful response
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
data
object[]
required
{
"data": [
{
"id": "string"
}
]
}
Bad request
Unauthorized