Back

    Buyamia Directory API

    v1.0

    Search

    The Directory API offers three search methods to find businesses and products. Choose the method that best fits your use case.

    All search endpoints require the search permission scope.

    Search Methods

    MethodEndpointBest For
    Keyword SearchGET /v1/searchFast text matching by name/description
    Semantic SearchGET /v1/semantic-searchAI-powered natural language queries using vector embeddings
    Hybrid SearchGET /v1/hybrid-searchKeyword-first with automatic semantic fallback
    GET
    /v1/search

    Keyword search across businesses and products

    search
    GET
    /v1/semantic-search

    AI-powered vector similarity search

    search
    GET
    /v1/hybrid-search

    Keyword-first with semantic fallback

    search

    Keyword Search

    The basic keyword search endpoint performs text matching on business names and descriptions. It searches both businesses and products simultaneously.

    Query Parameters

    ParameterTypeRequiredDescription
    qstringYesSearch query string
    typestringNoFilter by type: business, product, or all (default: all)
    category_iduuidNoFilter by category
    region_iduuidNoFilter by region
    limitintegerNoResults per page (default: 20)
    offsetintegerNoResults to skip

    Example

    curl "https://rjpxllsycikfabazvkdh.supabase.co/functions/v1/directory-api/v1/search?q=furniture&type=business&limit=10" \
      -H "X-API-Key: your-key"

    Response

    {
      "data": {
        "businesses": [
          { "id": "uuid", "name": "PT Furniture Jaya", "slug": "pt-furniture-jaya", "description": "..." }
        ],
        "products": [
          { "id": "uuid", "name": "Executive Desk", "slug": "executive-desk", "price": 5500000 }
        ]
      },
      "pagination": { "total": 25, "limit": 10, "offset": 0, "has_more": true }
    }
    Last updated on February 23, 2026