Skip to navigation

Pagination and Filtering

Page through results and narrow them down
View as Markdown

The examples use POST /v1/entities/search with an API key in AUTH_TOKEN. Other list operations share the page fields, but their defaults and sortable fields differ; check each operation in the API reference.

Paging

Set size explicitly so page sizes stay predictable across API versions.

ParameterDefaultMeaning
page0Zero-based page index; the first page is 0, not 1
sizeVaries by operationRecords per page
sortNoneproperty,(asc|desc); repeat the parameter for more criteria
curl -X POST -H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" -d '{}' \
"https://api.aventure.vc/v1/entities/search?page=2&size=50&sort=nameBrand,asc"

Sort order is ascending when you omit the direction, so sort=nameBrand and sort=nameBrand,asc are the same request.

Only some fields are sortable, and they are not the same set as the filter names. Sorting by a filter name such as entityName returns 422, and its detail lists every sortable property. POST /v1/search does not accept sort, because each record type in its response is ordered by relevance.

Reading the Page Object

Records are in content. The other fields tell you where you are:

{
"content": [ ... ],
"number": 2,
"size": 50,
"numberOfElements": 50,
"totalElements": 12345,
"totalPages": 247,
"first": false,
"last": false,
"empty": false
}

Request pages until last is true instead of computing the final page index yourself, because totalElements can change between requests as records are added.

Filtering

Filters go in the JSON body; page, size, and sort stay in the query string. Most filters take arrays, where several values mean any of these:

# Companies headquartered in either country
curl -X POST -H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"typeRecord":["Company"],"headquartersCountry":["US","CA"]}' \
"https://api.aventure.vc/v1/entities/search?size=40"

Different filters must all match:

# Seed-stage companies headquartered in the US
curl -X POST -H "Authorization: Bearer $AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"typeRecord":["Company"],"stage":["Seed"],"headquartersCountry":["US"]}' \
"https://api.aventure.vc/v1/entities/search?size=40"

POST /v1/entities/search accepts these main groups of body filters:

  • Identity: entityId, slug, entityName (exact match on the normalized name), url, urlDomain
  • Classification: industry, mainProduct, typeModel, typeOwnership, typeCustomer, typeRecord, tag
  • Location: headquartersCountry, headquartersState, headquartersCity
  • Accelerator: acceleratorBrand, acceleratorName, acceleratorCohort, acceleratorStatus
  • Funding: the nested fundraiseActivity object, covering round, amounts raised and invested, valuation, and last round year
  • Ranges: yearFoundedRange and employeeCountRange, arrays of objects with inclusive min and max bounds
  • Presence and quality: hasFundraising, operatingStatus, qualityGate

Location filters take full names, not postal abbreviations: "headquartersState":["Texas"] matches, and "headquartersState":["TX"] returns no records.

GET /v1/entities/filters lists each filter with its accepted values, so use it to discover what a classification filter accepts:

curl -H "Authorization: Bearer $AUTH_TOKEN" \
"https://api.aventure.vc/v1/entities/filters?typeRecord=Company"

Three inputs look similar and do different things:

  • entityName matches the normalized brand or legal name exactly. Use it when you know the company’s name.
  • textSearch matches company identity text: brand names, legal names, slugs, and aliases.
  • POST /v1/search takes a plain-English request, turns it into filters, and searches companies, people, and news together. It requires a credential and a plan that includes search.

POST /v1/entities/search is a read and requires a credential. Its default size is 25. Add semanticQuery to the filter body to match on meaning instead of wording; keep explicit filters for hard constraints.

Counting Without Fetching

On POST /v1/entities/search, countOnly=true returns the number of matches in totalElements and returns no records. content is empty even when records match, so do not use empty to decide whether the query matched.