Skip to main content
POST
/
models
/
instances
/
search
Python SDK
from cognite.client.data_classes.data_modeling import ViewId
res = client.data_modeling.instances.search(
    ViewId("mySpace", "PersonView", "v1"),
    query="Arnold",
    properties=["name"])

from cognite.client.data_classes.data_modeling import ViewId
from cognite.client.data_classes import filters
born_after_1970 = filters.Range(["mySpace", "PersonView/v1", "birthYear"], gt=1970)
res = client.data_modeling.instances.search(
    ViewId("mySpace", "PersonView", "v1"),
    query="Quentin",
    properties=["name"],
    filter=born_after_1970)
{
  "items": [
    {
      "instanceType": "node",
      "version": 123,
      "space": "<string>",
      "externalId": "<string>",
      "createdTime": 1730204346000,
      "lastUpdatedTime": 1730204346000,
      "type": {
        "space": "<string>",
        "externalId": "<string>"
      },
      "deletedTime": 1730204346000,
      "properties": {}
    }
  ],
  "typing": {}
}

Authorizations

Authorization
string
header
required

Access token issued by the CDF project's configured identity provider. Access token must be an OpenID Connect token, and the project must be configured to accept OpenID Connect tokens. Use a header key of 'Authorization' with a value of 'Bearer $accesstoken'. The token can be obtained through any flow supported by the identity provider.

Body

application/json

The search specification.

Searching nodes or edges using properties from a view

view
object
required

Reference to a view

query
string

Query string that will be parsed and used for search.

instanceType
enum<string>
default:node

Limit the search query to searching nodes or edges. Unless you set the item type to apply the search to, the service will default to searching nodes within the view.

Available options:
node,
edge
properties
string[]

Optional array of properties you want to search through. If you do not specify one or more properties, the service will search all text fields within the view.

targetUnits
object[]

Properties to convert to another unit. The API can only convert to another unit, if a unit has been defined as part of the type on the underlying container being queried.

Required array length: 1 - 10 elements
filter
and · object

Build a new query by combining other queries, using boolean operators. We support the and, or, and not boolean operators.

Example:
{
"and": [
{
"in": {
"property": ["tag"],
"values": [10011, 10011]
}
},
{
"range": { "property": ["weight"], "gte": 0 }
}
]
}
includeTyping
boolean
default:false

Should we return property type information as part of the result?

sort
object[]
Maximum array length: 5
operator
enum<string>
default:OR

Controls how multiple search terms are combined when matching documents.

  • OR (default): A document matches if it contains any of the query terms in the searchable fields. This typically returns more results but with lower precision.

  • AND: A document matches only if it contains all of the query terms across the searchable fields. This typically returns fewer results but with higher relevance.

Available options:
AND,
OR
limit
integer
default:1000

Limits the number of results to return.

Required range: 1 <= x <= 1000

Response

Search query results

items
object[]
required

List of nodes and edges

Node

typing
object

Spaces for the requested view and containers

Last modified on April 23, 2026