मुख्य सामग्री पर जाएं

Earn API

को अपडेट
Jul 31, 2026

Earn provides a public HTTP API for integrating its vault and strategy workflows into applications and AI agents. The API returns data and unsigned transactions while your wallet retains control of signing.

TL;DR
  • Read Earn data. Retrieve platform configuration, vaults, wallet information, strategies, and positions.
  • Manage strategies. Create, update, and close strategies through SIWE-authorized requests.
  • Prepare transactions. Get unsigned transaction data for approvals, deposits, withdrawals, and emergency claims.
  • Keep wallet control. Your wallet signs and broadcasts transactions; the API never holds your keys.
  • Include the public API key. Every request uses the published apikey header. State-changing writes also require Sign-In with Ethereum (SIWE).

Base URL

Send every request to the documented production server:

https://earn-api.quicknode.dev/functions/v1/api

Endpoint paths include the API version. For example, the deployment configuration endpoint is GET /v1/config.

प्रमाणीकरण

Every request requires the public apikey header published by Earn. This key identifies requests to the API but does not authorize access to a wallet or its funds.

curl --request GET \
--url 'https://earn-api.quicknode.dev/functions/v1/api/v1/config' \
--header 'Accept: application/json' \
--header 'apikey: <EARN_PUBLIC_API_KEY>'

The API key is public by design and is not an authorization credential. Use the following key for production requests:

sb_publishable_3xcdKa_uMRhK71Izd6BLdg_2vskXZ_h

Requests that change wallet preferences or strategy state also require a valid Sign-In with Ethereum (SIWE) proof. The SIWE signature authorizes the write request for the connected wallet.

अंतिमबिंदुओं

The Earn API contains 27 operations grouped by resource. Select an operation to view its parameters, request body, cURL example, response fields, examples, and documented errors.

Discovery

तरीकाEndpointविवरण
पाना/v1Get the machine-readable API index
पाना/v1/openapi.jsonGet the OpenAPI 3.1 document

Platform

तरीकाEndpointविवरण
पाना/v1/configGet the public deployment configuration
पाना/v1/statsGet platform-wide aggregate statistics
पाना/v1/pricesGet native gas-token prices in USD

Vaults

तरीकाEndpointविवरण
पाना/v1/vaultsList approved vaults
पाना/v1/vaults/rankingsPreview a ranked allocation
पाना/v1/vaults/{chainId}/{address}Get an approved vault
पाना/v1/vaults/{chainId}/{address}/apyGet a vault's APY history

पर्स

तरीकाEndpointविवरण
पाना/v1/wallets/{addr}/balancesGet USDC and native gas balances
पाना/v1/wallets/{addr}/approvalsGet allowances and approval templates
पाना/v1/wallets/{addr}/prefsGet wallet preferences
PATCH/v1/wallets/{addr}/prefsUpdate wallet preferences
डाक/v1/wallets/{addr}/tosRecord a Terms of Service agreement
डाक/v1/wallets/{addr}/opencover-termsRecord an OpenCover terms acknowledgment

Strategies

तरीकाEndpointविवरण
पाना/v1/strategiesList a wallet's strategies
डाक/v1/strategiesCreate a strategy
पाना/v1/strategies/{id}Get a strategy
PATCH/v1/strategies/{id}Update a strategy
DELETE/v1/strategies/{id}Delete or close a strategy
पाना/v1/strategies/{id}/historyGet strategy events
पाना/v1/strategies/{id}/bridgesGet CCTP bridge transfers
पाना/v1/strategies/{id}/performanceGet strategy value and yield history
पाना/v1/strategies/{id}/intents/{intentId}Get an intent's lifecycle status

Calldata

तरीकाEndpointविवरण
डाक/v1/strategies/{id}/calldata/depositGenerate deposit calldata
डाक/v1/strategies/{id}/calldata/withdrawGenerate withdraw or close calldata
डाक/v1/strategies/{id}/calldata/claimGenerate emergency CCTP claim calldata

API reference

Use the interactive API reference to explore the available endpoints and request formats:

Earn API reference
Explore every endpoint in the interactive API documentation.
Open reference

The machine-readable OpenAPI 3.1 specification is available at GET /v1/openapi.json for generating client tools.

What you can do

The API supports the following documented workflows:


  • Read vaults, strategies, and positions
  • Create a new strategy
  • Update an existing strategy's configuration
  • Close an existing strategy
  • Prepare transaction data for approvals, deposits, withdrawals, and emergency claims

How authorization works

Earn remains non-custodial when you use the API. It returns unsigned transaction data for your wallet to sign and broadcast; it does not hold your keys or move funds.

अनुरोधAuthorization
Every API requestRequires the published public apikey header. This key is not the wallet authorization credential.
Read requestsPublic after including the apikey header; no SIWE signature is required.
Calldata requestsPublic after including the apikey header. The returned on-chain transaction must still be signed by the wallet.
State-changing API writesRequire a Sign-In with Ethereum (SIWE) signature.

For strategy creation, the wallet recovered from the SIWE signature becomes the strategy owner. The API does not require an account login or a private API credential.

Units


Earn uses different unit formats for display values and on-chain transaction values.

  • Read models return USDC values as decimal-dollar JSON numbers. For example, 1234.56 represents 1,234.56 USDC.
  • APY fields are percentage numbers rather than fractions. For example, 5.423 represents 5.423% APY.
  • Transaction templates, approval templates, balances, and allowances use base-unit strings. USDC uses six decimals, native gas uses wei, and share values use raw integer strings.

Where to go next