Data Selections
posthttps://api-atlas.nomic.ai/v1/query
Execute a query with the given projection ID and filters.
The below example demonstrates how to call the endpoint using curl. It includes the projection_id of our Atlas dataset, and a selection with filters for "comfortable" and "outdoor" in the title field.
The results will be all the data in the dataset with both the terms "comfortable" and "outdoor" in the title field.
See this guide for a more detailed walkthrough.
curl -X POST 'https://api-atlas.nomic.ai/v1/query' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer $NOMIC_API_KEY' \
-d '{
"projection_id": "f1e499cd-b5c1-4d31-b38a-fff61e1f8b59",
"selection": {
"method": "composition",
"conjunctor": "ALL",
"filters": [
{
"method": "search",
"query": "comfortable",
"field": "title"
},
{
"method": "search",
"query": "outdoor",
"field": "title"
}
]
}
}'
Request
Body (required) application/json
projection_idstring ($uuid)*requiredselectionobject*requiredmethodstring*requiredPossible values: composition
polaritybooleanDefault: true
conjunctorstring*requiredPossible values: ANY, ALL
cherriesobjectpolaritybooleanDefault: true
methodstring*requiredPossible values: cherrypick
addedarray<array<any>>Default: []
removedarray<array<any>>Default: []
fieldstringfiltersarray<object>Responses
200Returns the datum IDs for each point in your dataset included in your selection.
dataarray<object>*required400Bad request
401Unauthorized
Examples
curl
curl -X 'POST' \
'https://api-atlas.nomic.ai/v1/query' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"projection_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"selection": {
"method": "composition",
"polarity": true,
"conjunctor": "ANY",
"cherries": {
"polarity": true,
"method": "cherrypick",
"added": [],
"removed": [],
"field": "string"
},
"filters": [
{
"polarity": null,
"method": "search",
"query": "string",
"field": "string",
"ignoreCase": true,
"regex": false,
"wordBoundary": false
},
{
"polarity": null,
"method": "range",
"field": "string",
"range": [
null
]
},
{
"polarity": null,
"method": "category",
"field": "string",
"values": null
},
{
"method": "composition",
"polarity": true,
"conjunctor": "ANY",
"cherries": {},
"filters": [
null,
null,
null,
null
]
}
]
}
}'