Skip to main content

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

Body

required

    projection_id uuidrequired

    selection

    object

    method stringrequired

    Possible values: [composition]

    polarity boolean

    Default value: true

    conjunctor stringrequired

    Possible values: [ANY, ALL]

    cherries

    object

    polarity boolean

    Default value: true

    method stringrequired

    Possible values: [cherrypick]

    added array[]

    Possible values: >= 2, <= 2

    Default value: ``

    removed array[]

    Possible values: >= 2, <= 2

    Default value: ``

    field stringnullable

    filters

    object[]

  • Array [

  • oneOf

    polarity boolean

    Default value: true

    method stringrequired

    Possible values: [search]

    query stringrequired
    field stringrequired
    ignoreCase boolean

    Default value: true

    regex boolean
    wordBoundary boolean
  • ]

Responses

Successful response

Schema

    data

    object[]

    required

  • Array [

  • id stringrequired
  • ]

Loading...