Examples
Worked discover requests for each search mode.
Worked discover requests for each search mode. Each request body is sent to POST /discover.
1. Text Search
Search using keywords or natural language queries. DISCOVR supports both simple keyword matching and natural language understanding — you can search the way your users would ask.
Keyword Search
{
"context": {
"version": "2.0.0",
"action": "discover",
"messageId": "55555555-5555-5555-5555-555555555555",
"transactionId": "66666666-6666-6666-6666-666666666666",
"timestamp": "2026-03-26T11:00:00Z",
"bapId": "bap.myapp.in",
"bapUri": "https://bap.myapp.in",
"networkId": "retail-grocery"
},
"message": {
"intent": {
"textSearch": "Coffee"
}
}
}Natural Language Search
You can also use natural language queries — the service understands conversational phrasing and extracts the relevant search intent:
The service matches against resource names, descriptions, and domain-specific attributes to find the most relevant results.
2. Spatial Search
Find resources available near a location. Uses spatial queries with CQL2-JSON semantics.
This finds all resources available within 1 km of the specified coordinates (Mysore in this example).
op
Spatial operation — S_DWITHIN (within distance)
targets
JSONPath to the geo field in the resource
geometry
GeoJSON point with [longitude, latitude]
distanceMeters
Search radius in meters
3. JSONPath Filter
Query resources and offers using JSONPath expressions for fine-grained attribute filtering.
This finds all offers with a flat discount where the price is under 100.
4. Combining Search Modes
You can combine text search with spatial or filter queries in a single request:
This finds coffee-related resources available within 5 km of Bengaluru HSR Layout.
5. Retrieving Inactive or Expired Catalogs
By default DISCOVR returns only active and currently-valid catalogs. To retrieve catalogs that are inactive or outside their validity window, pass the active and/or validity query parameters on the request URL. The request body is unchanged.
Returns only catalogs that are provably out of their validity window (expired or not yet valid):
Other combinations:
POST /discover (no params)
Active, currently-valid catalogs (default)
POST /discover?active=false
Only catalogs explicitly marked inactive
POST /discover?validity=false
Only expired / not-yet-valid catalogs
POST /discover?active=false&validity=false
Only catalogs that are both inactive and out of window
See Usage for the full semantics.
See Usage for the full response format.
Last updated
Was this helpful?