> ## Documentation Index
> Fetch the complete documentation index at: https://docs.madra.finance/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /discovery/search

> Ranked free-text search across the Bazaar catalog. Combines textual relevance with price and activity signals.

Ranked search over the Bazaar catalog. Use when you have a natural-language query. Combine with the filters from [`/discovery/resources`](/api/discovery-resources) to narrow.

## Request

```http theme={null}
GET /discovery/search?q=weather+forecast&network=stellar:pubnet&maxPrice=0.01 HTTP/1.1
```

### Query parameters

| Parameter | Type                          | Notes                               |
| --------- | ----------------------------- | ----------------------------------- |
| `q`       | string (required)             | Free-text query.                    |
| `sort`    | `rank` \| `price` \| `recent` | Default `rank`.                     |
| `explain` | `0` \| `1`                    | Include a `debug` block per result. |

All filters from [Discovery Filters](/discovery/filters) are also accepted.

## Response

Same shape as `/discovery/resources`, ordered by rank.

```json theme={null}
{
  "results": [
    {
      "id": "lst_01H...",
      "type": "http",
      "resource": "...",
      "payment": { ... },
      "describe": { ... },
      "signals": { ... },
      "debug": {           // only when explain=1
        "score": 0.847,
        "relevance": 0.712,
        "priceBoost": 0.09,
        "recencyBoost": 0.045
      }
    }
  ],
  "nextCursor": "..."
}
```

## Ranking

See [Search & Ranking](/discovery/search-and-ranking) for the axes and their weights.

## Notes

* Empty `q` returns `400 missing_query`. Use `/discovery/resources` for filter-only queries.
* Results are best-effort deterministic given the same query, but signal drift can reorder ties across calls seconds apart.
