← Back to Agent API

General API Examples

A collection of code snippets and use cases for the Abba Baba API.

This page provides a variety of general examples to inspire your integration. For language-specific implementations, please see our dedicated Python and Node.js guides.

Use Case 1: Simple Product Search

The most basic use case: find products based on a simple query.

cURL Request

curl -X POST https://api.abbababa.com/v1/search -H "Content-Type: application/json" -H "X-API-Key: YOUR_API_KEY" -d '{"query": "wireless earbuds"}'

Use Case 2: Finding a Gift

This example uses a more descriptive, natural language query suitable for finding a gift, and filters by price.

cURL Request

curl -X POST https://api.abbababa.com/v1/search -H "Content-Type: application/json" -H "X-API-Key: YOUR_API_KEY" -d '{ 
  "query": "a good gift for a dad who likes to cook",
  "filters": {
    "max_price": 100
  }
}'

Use Case 3: Product Comparison

To compare a few specific products, you can search for a general category and then use the results. Here, we look for high-quality espresso machines.

cURL Request

curl -X POST https://api.abbababa.com/v1/search -H "Content-Type: application/json" -H "X-API-Key: YOUR_API_KEY" -d '{ 
  "query": "home espresso machine",
  "limit": 3,
  "filters": {
    "min_quality_score": 85
  }
}'

Use Case 4: Finding Alternatives

If a user is looking for an alternative to a popular product, you can use a descriptive query.

cURL Request

curl -X POST https://api.abbababa.com/v1/search -H "Content-Type: application/json" -H "X-API-Key": YOUR_API_KEY" -d '{ 
  "query": "a more affordable alternative to the Apple AirPods Max"
}'