Skip to main content
GET
/
v2
/
x402
/
discovery
/
search
Search x402 resources
curl --request GET \
  --url https://api.cdp.coinbase.com/platform/v2/x402/discovery/search \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.cdp.coinbase.com/platform/v2/x402/discovery/search"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.cdp.coinbase.com/platform/v2/x402/discovery/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cdp.coinbase.com/platform/v2/x402/discovery/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.cdp.coinbase.com/platform/v2/x402/discovery/search"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.cdp.coinbase.com/platform/v2/x402/discovery/search")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.cdp.coinbase.com/platform/v2/x402/discovery/search")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "x402Version": 2,
  "resources": [
    {
      "resource": "https://api.example.com/weather/forecast",
      "description": "Real-time weather forecast data.",
      "type": "http",
      "x402Version": 2,
      "lastUpdated": "2024-01-15T10:30:00Z",
      "extensions": {
        "bazaar": {
          "info": {
            "input": {
              "type": "http",
              "method": "GET"
            }
          },
          "schema": {}
        }
      },
      "accepts": [
        {
          "scheme": "exact",
          "network": "eip155:8453",
          "amount": "1000000",
          "payTo": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
          "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
          "maxTimeoutSeconds": 60
        }
      ],
      "quality": {
        "l30DaysTotalCalls": 42,
        "l30DaysUniquePayers": 15,
        "lastCalledAt": "2024-01-15T10:30:00Z"
      }
    }
  ],
  "partialResults": false,
  "searchMethod": "text"
}
{
"errorType": "invalid_request",
"errorMessage": "limit must be a positive integer."
}
{
"errorType": "internal_server_error",
"errorMessage": "An internal server error occurred. Please try again later."
}
{
"errorType": "bad_gateway",
"errorMessage": "Bad gateway. Please try again later."
}
{
"errorType": "service_unavailable",
"errorMessage": "Service unavailable. Please try again later."
}

Query Parameters

query
string

Full-text or semantic search query to find matching resources.

Maximum string length: 400
Example:

"weather forecast"

network
string

Filter results by network in CAIP-2 format (e.g., eip155:8453) or legacy name (e.g., base, base-sepolia, solana). Legacy names are normalized to their CAIP-2 equivalents before filtering.

Example:

"eip155:8453"

asset
string

Filter results by asset address. For EVM networks, provide a 0x-prefixed EVM address. For Solana networks, provide a base58-encoded address. Matching is case-insensitive.

Example:

"0x036CbD53842c5426634e7929541eC2318f3dCF7e"

scheme
string

Filter results by payment scheme (e.g., exact).

Example:

"exact"

payTo
string

Filter results by the merchant's payment address. For EVM networks, provide a 0x-prefixed EVM address. For Solana networks, provide a base58-encoded address. A blockchain address. Format varies by network (e.g., 0x-prefixed for EVM, base58 for Solana).

Required string length: 1 - 128
Example:

"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"

urlSubstring
string

Filter results to resources whose URL contains this value (case-insensitive substring match against the resource URL). Useful for narrowing results to a specific domain, subdomain, or path segment. Combine with query to perform semantic search restricted to a URL subset. Tip: include enough of the URL to disambiguate (e.g. api.example.com rather than example) — a short substring may also match resources whose path contains the same string.

Required string length: 3 - 2048
Example:

"api.example.com"

maxUsdPrice
string

Filter results to resources with a USD price at or below this value.

Example:

"1.00"

extensions
string[]

Filter results to resources that support the specified protocol extensions. Can be specified multiple times to filter by multiple extensions.

Example:
["bazaar"]
limit
integer
default:20

Maximum number of resources to return. Must be a positive integer no greater than 20. Defaults to 20.

Required range: 1 <= x <= 20

Response

Successfully retrieved matching x402 resources.

Response from a search for x402 resources.

resources
object[]
required

List of x402 resources matching the search query and filters.

Example:
[
{
"resource": "https://api.example.com/weather/forecast",
"description": "Real-time weather forecast data.",
"type": "http",
"x402Version": 2,
"lastUpdated": "2024-01-15T10:30:00Z",
"accepts": [
{
"scheme": "exact",
"network": "eip155:8453",
"amount": "1000000",
"payTo": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
"asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"maxTimeoutSeconds": 60
}
],
"extensions": {
"bazaar": {
"info": {
"input": { "type": "http", "method": "GET" }
},
"schema": {}
}
},
"quality": {
"l30DaysTotalCalls": 42,
"l30DaysUniquePayers": 15,
"lastCalledAt": "2024-01-15T10:30:00Z"
},
"serviceName": "Weather API",
"tags": ["weather", "data"],
"iconUrl": "https://res.cloudinary.com/bdb-prod/image/upload/..."
}
]
partialResults
boolean
required

Indicates whether the result set was truncated because there were more results than the requested limit.

Example:

false

x402Version
enum<integer>
required

The version of the x402 protocol.

Available options:
1,
2
Example:

2

searchMethod
enum<string>

The search method used to retrieve the results (e.g., "text", "vector", "hybrid").

Available options:
text,
vector,
hybrid
Example:

"text"