Unsigned transactions that buy a tokenized stock on Base with USDC for your own wallet, checked against the stock token's Chainlink price.
curl --request GET \
--url https://x402.ottoai.services/stock-buy-tximport requests
url = "https://x402.ottoai.services/stock-buy-tx"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://x402.ottoai.services/stock-buy-tx', 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://x402.ottoai.services/stock-buy-tx",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://x402.ottoai.services/stock-buy-tx"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://x402.ottoai.services/stock-buy-tx")
.asString();require 'uri'
require 'net/http'
url = URI("https://x402.ottoai.services/stock-buy-tx")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {}
}DeFi & Markets Data
/stock-buy-tx
Unsigned transactions that buy a tokenized stock on Base (Coinbase B20) with USDC, for your own wallet: the USDC approval when it is needed, then the LI.FI swap. Otto checks the route’s worst fill against the stock token’s own Chainlink price (at most 1.75% over it) and caps slippage at 1%. The quote includes LI.FI’s fee and Otto’s 0.1% fee. Nothing is signed or sent. buy=TICKER:amountUsdc:wallet, optional :slippageBps. $0.01 per call.
GET
/
stock-buy-tx
Unsigned transactions that buy a tokenized stock on Base with USDC for your own wallet, checked against the stock token's Chainlink price.
curl --request GET \
--url https://x402.ottoai.services/stock-buy-tximport requests
url = "https://x402.ottoai.services/stock-buy-tx"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://x402.ottoai.services/stock-buy-tx', 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://x402.ottoai.services/stock-buy-tx",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://x402.ottoai.services/stock-buy-tx"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://x402.ottoai.services/stock-buy-tx")
.asString();require 'uri'
require 'net/http'
url = URI("https://x402.ottoai.services/stock-buy-tx")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {}
}Price: 0.01 USDC per call, paid on Base or Solana.
Fill in the required fields and send this request without payment to get the live price quote. The API answers
402 and lists the price, network and token in accepts. To pay, follow Your first paid call.Query Parameters
Was this page helpful?
