import EntityQueryKnex from '/docs/snippets/entity-query-knex.md'
import BackendIntroCrosslink from '/docs/snippets/backend-custom-intro-crosslink.md'
import ESdeprecated from '/docs/snippets/entity-service-deprecated.md'
Entity Service API#
Before diving deeper into the Entity Service API documentation, it is recommended that you read the following introductions:
- the backend customization introduction,
- and the Content APIs introduction.
The Strapi backend provides an Entity Service API, built on top of the Query Engine API. The Entity Service is the layer that handles Strapi's complex content structures like components and dynamic zones, and uses the Query Engine API under the hood to execute database queries.
:::strapi Entity Service API vs. Query Engine API
:::
:::info Disambiguation: Services vs. Entity Service
While services can use the Entity Service API, services and the Entity Service API are not directly related. You can find more information about the core elements of the Strapi back end in the back-end customization documentation.
:::
Basic usage#
The Entity Service is available through strapi.entityService:
const entry = await strapi.entityService.findOne('api::article.article', 1, {
populate: { someRelation: true },
});
Available operations#
The Entity Service API allows the following operations on entities: