Get a Large Number of Entities by Name
Look up thousands of custom entities by name, staying within the per-request name filter limit by chunking the name list.
This recipe uses the V3 API through the
V3 Python SDK. The custom entity list endpoint is stable,
so the client doesn’t need early_access. long_list_of_entity_names is a placeholder for your own
list of names.
SDK boilerplate
Import the V3 SDK and instantiate the client. Pass your tenant’s root URL and your API key; the SDK adds
/api/v3itself.Write a chunking helper
A generator that yields successive slices of a list. The name filter accepts at most 100 names per request, so a list of thousands of names has to be split up.
Iterate the chunks
Drop any
Noneentries first, then handle one chunk of at most 100 names per pass of the loop.Request the entities
One list call per chunk. Use
name_any_of_case_sensitiverather thanname_any_of: the case-insensitive filter can be non-performant. The SDK sends the names as a comma-separatedname.anyOf.caseSensitivequery parameter onGET /api/v3/custom-entity/items.Iterating the pager fetches every page of matches, so a chunk that matches more than
page_sizeentities still returns all of them. The response tab shows the shape of one page, trimmed for brevity.
V3 returns the standard {items, nextToken} envelope rather than V2’s
{customEntities, nextToken}, and uses typedSchema in place of the deprecated schema field.