Anythink Search
How search works
Every time you create or update a record in Anythink, it is automatically indexed for search. There is no setup — indexing happens in the background as you write data.
You can search across all entities at once, or scope the search to a specific entity using the e parameter.
The search endpoint
Authenticated search
Use this for searches from your backend or from authenticated frontend sessions:
GET /org/{orgId}/search?q={query}&e={entity}&page=1&pageSize=20
| Parameter | Required | Description |
|---|---|---|
q |
No | Search query. Defaults to * (return everything) |
e |
No | Entity name to scope the search (e.g. products). Omit to search all entities |
page |
No | Page number, default 1 |
pageSize |
No | Results per page, default 20 |
Example — search for "headphones" across all entities:
GET /org/{orgId}/search?q=headphones
Example — search for "headphones" in the products entity only:
GET /org/{orgId}/search?q=headphones&e=products
Public search
Use this for unauthenticated search from a public-facing frontend (no JWT required):
GET /org/{orgId}/search/public?q={query}&e={entity}
The public endpoint supports the same q, e, page, and pageSize parameters. It only returns records from entities that do not require authentication to read.
Response format
Search returns a paginated result set:
{
"items": [
{
"id": 5,
"name": "Wireless Headphones",
"description": "Over-ear, noise cancelling",
"price": 79.99
}
],
"total_items": 1,
"page": 1,
"page_size": 20,
"has_next_page": false
}
Results include all fields on the matching record. Use standard pagination parameters to page through large result sets.
Wildcard search
Pass q=* (or omit q entirely) to return all indexed records for an entity. Useful for populating dropdowns or pre-loading data:
GET /org/{orgId}/search?q=*&e=categories
Search from your frontend
const orgId = 'YOUR_ORG_ID';
const token = 'YOUR_TOKEN';
async function search(query, entity = null) {
const params = new URLSearchParams({ q: query });
if (entity) params.append('e', entity);
const res = await fetch(
`https://api.my.anythink.cloud/org/${orgId}/search?${params}`,
{ headers: { 'Authorization': `Bearer ${token}` } }
);
return res.json();
}
// Search all entities
const results = await search('coffee');
// Search a specific entity
const products = await search('coffee', 'products');
For public-facing sites (no auth), use the /search/public endpoint instead and omit the Authorization header.
Re-indexing
If you suspect search results are stale or an entity has data that is missing from results, you can trigger a re-index from the dashboard under Settings → Search. This forces all records for an entity to be re-indexed.
Re-indexing runs in the background and does not affect live traffic.