---
title: "POST /v1/projects/{projectId}:lookup"
method: POST
path: "/v1/projects/{projectId}:lookup"
tags: ["projects"]
---

# POST /v1/projects/{projectId}:lookup

`POST /v1/projects/{projectId}:lookup`

Looks up entities by key.

## Path parameters

- `projectId` string, required

## Request body

- LookupRequest — The request for Datastore.Lookup.
  - `keys` Key[] — Required. Keys of entities to look up.
    - `partitionId` PartitionId — A partition ID identifies a grouping of entities. The grouping is always by project and namespace, however the namespace ID may be empty. A partition ID contains several dimensions: project ID and namespace ID. Partition dimensions: - May be `""`. - Must be valid UTF-8 bytes. - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}` If the value of any dimension matches regex `__.*__`, the partition is reserved/read-only. A reserved/read-only partition ID is forbidden in certain documented contexts. Foreign partition IDs (in which the project ID does not match the context project ID ) are discouraged. Reads and writes of foreign partition IDs may fail if the project is not in an active state.
      - `projectId` string — The ID of the project to which the entities belong.
      - `databaseId` string — If not empty, the ID of the database to which the entities belong.
      - `namespaceId` string — If not empty, the ID of the namespace to which the entities belong.
    - `path` PathElement[] — The entity path. An entity path consists of one or more elements composed of a kind and a string or numerical identifier, which identify entities. The first element identifies a _root entity_, the second element identifies a _child_ of the root entity, the third element identifies a child of the second entity, and so forth. The entities identified by all prefixes of the path are called the element's _ancestors_. An entity path is always fully complete: *all* of the entity's ancestors are required to be in the path along with the entity identifier itself. The only exception is that in some documented cases, the identifier in the last path element (for the entity) itself may be omitted. For example, the last path element of the key of `Mutation.insert` may have no identifier. A path can never be empty, and a path can have at most 100 elements.
      - `name` string — The name of the entity. A name matching regex `__.*__` is reserved/read-only. A name must not be more than 1500 bytes when UTF-8 encoded. Cannot be `""`. Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as `__bytes__` where `` is the base-64 encoding of the bytes.
      - `kind` string — The kind of the entity. A kind matching regex `__.*__` is reserved/read-only. A kind must not contain more than 1500 bytes when UTF-8 encoded. Cannot be `""`. Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are encoded as `__bytes__` where `` is the base-64 encoding of the bytes.
      - `id` string, int64 — The auto-allocated ID of the entity. Never equal to zero. Values less than zero are discouraged and may not be supported in the future.
  - `readOptions` ReadOptions — The options shared by read requests.
    - `readTime` string, google-datetime — Reads entities as they were at the given time. This value is only supported for Cloud Firestore in Datastore mode. This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.
    - `newTransaction` TransactionOptions — Options for beginning a new transaction. Transactions can be created explicitly with calls to Datastore.BeginTransaction or implicitly by setting ReadOptions.new_transaction in read requests.
      - `readWrite` ReadWrite — Options specific to read / write transactions.
        - `previousTransaction` string, byte — The transaction identifier of the transaction being retried.
      - `readOnly` ReadOnly — Options specific to read-only transactions.
        - `readTime` string, google-datetime — Reads entities at the given time. This must be a microsecond precision timestamp within the past one hour, or if Point-in-Time Recovery is enabled, can additionally be a whole minute timestamp within the past 7 days.
    - `readConsistency` 'READ_CONSISTENCY_UNSPECIFIED' | 'STRONG' | 'EVENTUAL' — The non-transactional read consistency to use.
    - `transaction` string, byte — The identifier of the transaction in which to read. A transaction identifier is returned by a call to Datastore.BeginTransaction.
  - `propertyMask` PropertyMask — The set of arbitrarily nested property paths used to restrict an operation to only a subset of properties in an entity.
    - `paths` string[] — The paths to the properties covered by this mask. A path is a list of property names separated by dots (`.`), for example `foo.bar` means the property `bar` inside the entity property `foo` inside the entity associated with this path. If a property name contains a dot `.` or a backslash `\`, then that name must be escaped. A path must not be empty, and may not reference a value inside an array value.
  - `requestOptions` RequestOptions — Options for a request.
    - `requestTags` string[] — Optional. The request tags for the request. The tags are processed as follows: - Truncated to 510 characters. - Filtered out if empty. - Deduplicated. - Limited to 50 tags.
  - `databaseId` string — The ID of the database against which to make the request. '(default)' is not allowed; please use empty string '' to refer the default database.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/datastore.md) · [All operations](https://skmtc.dev/google/apis/datastore/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/datastore/revisions/aef4907227b2/schema)
