- Standardized query syntax: Enables consistent filtering, sorting, pagination, and projections across different data sources.
- Metadata support: Clients can discover the data structure and types via metadata documents.
- Interoperability: Any client that supports HTTP and understands OData can consume OData services.
Assets, events, sequences, and asset-centric file and time series metadata in the asset-centric OData service are deprecated. Use the data modeling OData service for data modeling resources. See Deprecated and retired features.
Using the OData services
To interact with the Cognite OData services, you make HTTP GET requests to specific endpoints.Authenticate
To authenticate with the OData services, you must include a bearer token in the authorization header of your HTTP requests. For example:Make requests
To retrieve all assets in a project:{cluster}: The CDF cluster name (e.g., westeurope-1).{apiVersion}: The OData service API version (e.g., v1).{project}: Your CDF project name.
-
Filtering - use the
$filterquery parameter to filter data. Example: Retrieve assets whereNameequals'Pump 1':GET .../Assets?$filter=Name eq 'Pump 1' -
Selecting fields- use the
$selectquery parameter to retrieve specific fields. Example: Retrieve only theIdandNameof assets:GET .../Assets?$select=Id,Name -
Sorting - use the
$orderbyquery parameter to sort results. Example: Order assets byNameascending:GET .../Assets?$orderby=Name asc -
Expanding related entities - use the
$expandquery parameter to include related entities. Example: Retrieve an asset along with its parent:GET .../Assets(702630644612)/Parent?$expand=ParentNote: Not all entities and relationships support expansion. Refer to the individual service documentation for details. -
Combining query parameters - you can combine multiple query parameters to refine your request.
Example: Retrieve the
IdandNameof assets whereNamestarts with'Pump', ordered byName, and retrieve the first 10 results:GET .../Assets?$filter=startswith(Name,'Pump')&$select=Id,Name&$orderby=Name asc&$top=10
@odata.nextLink property with a URL to retrieve the next page of results.
Example: