Every API here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for apis
7 MCP tools reach this
find_apisBrowse and filter every API in the catalog.
get_api_artifactsOne API's artifacts, grouped by type.
get_openapiThe primary OpenAPI for this API.
find_similar_apisAPIs that look like this one.
apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
resolveTurn a domain, URL or GitHub org into the provider it belongs to.
find_cohortsEvery scored population of providers in the catalog.
All 92 tools →
Call it yourself
curl for this page
This API
curl "https://apis.io/api/v1/apis/layerhop-com:layerhop-com-social-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Layerhop Com Social API
version: 0.1.0
contact:
name: LayerHop
url: https://docs.layerhop.com
description: 'Operations tagged Social across 2 of this provider''s published API definitions: layerhop-com-openapi.yaml, openapi.yaml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.layerhop.com
description: Hosted API (production)
- url: http://localhost:8787
description: Local API (`pnpm --filter @layerhop/api dev`)
security:
- {}
- ApiKey: []
tags:
- name: Social
description: 'Copy trading and swap by reply (D-046): a public feed of swaps by wallets that opted in with a
signed message, and the Farcaster bot''s webhook. Every swap is still signed by the user in their
own wallet; the bots only reply with links.'
paths:
/v1/trade-feed:
get:
tags:
- Social
operationId: getTradeFeed
summary: Recent shared trades
description: 'Recent notable LayerHop swaps (worth at least `minUsd` at fill, both tokens listed, not tips,
split shares or payouts) by wallets that opted in with `POST /v1/trade-feed/opt-in`, newest
first, each with the `trader` address. Only swaps filled after the wallet''s latest opt-in are
shown, and an opt-out removes them at once. No wallet that didn''t opt in ever appears. Cached
30 seconds.'
parameters:
- name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 50
default: 20
- name: before
in: query
description: ISO 8601 time; only trades filled before it (paging).
schema:
type: string
format: date-time
responses:
'200':
description: Shared trades.
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
type: object
required:
- trades
- minUsd
properties:
trades:
type: array
items:
$ref: '#/components/schemas/FeedTrade'
minUsd:
type: number
example: 25
'400':
$ref: '#/components/responses/BadRequest'
servers:
- url: https://api.layerhop.com
description: Hosted API (production)
- url: http://localhost:8787
description: Local API (`pnpm --filter @layerhop/api dev`)
/v1/trade-feed/opt-in:
post:
tags:
- Social
operationId: setTradeSharing
summary: Opt in to (or out of) the trade feed
description: 'A wallet chooses whether its LayerHop swaps appear, with its address, in the public trade
feed. It signs the plain text `buildShareTradesMessage(fields)` from `@layerhop/shared`
(EIP-191 `personal_sign` on EVM, `signMessage` on Solana; free, moves no funds); the API
rebuilds the message from the fields sent here:
```text
LayerHop trade feed
Show my LayerHop swaps from now on, with my wallet address, in the public trade feed. Signing is free and does not move funds.
(or: Stop showing my LayerHop swaps in the public trade feed. Signing is free and does not move funds.)
Wallet:
Share trades: yes | no
Issued At:
```
`issuedAt` must be within the last 10 minutes, and newer than the wallet''s last recorded
choice (`CONFLICT` otherwise), so an old signature can''t be replayed to undo a newer one.
20 requests per IP per hour. Needs the platform database (`NOT_FOUND` without one).'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ShareTradesRequest'
example:
vm: evm
wallet: '0x1111111111111111111111111111111111111111'
enabled: true
issuedAt: '2026-10-29T09:00:00.000Z'
signature: 0x…
responses:
'200':
description: The recorded choice.
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TradeSharing'
'400':
$ref: '#/components/responses/BadRequest'
'401':
description: '`UNAUTHORIZED`: the signature doesn''t match the fields and the wallet.'
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
$ref: '#/components/responses/NotFound'
'409':
$ref: '#/components/responses/Conflict'
'429':
$ref: '#/components/responses/TooManyRequests'
servers:
- url: https://api.layerhop.com
description: Hosted API (production)
- url: http://localhost:8787
description: Local API (`pnpm --filter @layerhop/api dev`)
/v1/trade-feed/opt-in/{wallet}:
get:
tags:
- Social
operationId: getTradeSharing
summary: Whether a wallet shares its trades
parameters:
- name: wallet
in: path
required: true
description: EVM address (any case) or Solana base58 address.
schema:
type: string
example: '0x1111111111111111111111111111111111111111'
responses:
'200':
description: 'The wallet''s choice (`enabled: false` when it never opted in).'
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/TradeSharing'
'400':
$ref: '#/components/responses/BadRequest'
servers:
- url: https://api.layerhop.com
description: Hosted API (production)
- url: http://localhost:8787
description: Local API (`pnpm --filter @layerhop/api dev`)
/v1/social/farcaster/webhook:
post:
tags:
- Social
operationId: farcasterWebhook
summary: Farcaster bot webhook (Neynar)
description: 'Called by Neynar for casts that mention the LayerHop bot (`cast.created`). Not for direct
use. The body must be signed: `X-Neynar-Signature` is the HMAC-SHA512 (hex) of the raw body
with the webhook''s secret (`UNAUTHORIZED` otherwise). A swap request such as
"@layerhop swap 10 USDC to SOL" gets a reply cast with a link to a prefilled swap page (a
Farcaster Mini App); an ambiguous one gets a question; anything else is ignored. Each cast is
answered once. `NOT_FOUND` unless the deployment configured the bot.'
parameters:
- name: x-neynar-signature
in: header
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
type:
type: string
example: cast.created
data:
type: object
properties:
hash:
type: string
example: '0xa1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1'
text:
type: string
example: '@layerhop swap 10 USDC to SOL'
author:
type: object
properties:
fid:
type: integer
example: 42
username:
type: string
example: alice
responses:
'200':
description: Acknowledged; `action` says what the bot did.
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
type: object
required:
- ok
- action
properties:
ok:
type: boolean
action:
type: string
enum:
- replied
- clarified
- ignored
- duplicate
- skipped
- failed
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
servers:
- url: https://api.layerhop.com
description: Hosted API (production)
- url: http://localhost:8787
description: Local API (`pnpm --filter @layerhop/api dev`)
components:
schemas:
TradeExecution:
type: object
description: 'Promised vs received: amounts in base units of the destination token, USD at fill (null when unrecorded or the token is unlisted).'
required:
- quoted
- minimum
- received
- receivedUsd
- diffBps
- diffUsd
- metMinimum
- fees
properties:
quoted:
type: string
description: The quoted output (same as `dstAmount`).
minimum:
type:
- string
- 'null'
description: The quote's guaranteed minimum after slippage; null for orders built before it was recorded.
received:
type:
- string
- 'null'
description: Delivered to the recipient, read from the destination transaction; null until read or when unreadable.
receivedUsd:
type:
- number
- 'null'
diffBps:
type:
- number
- 'null'
description: (received − quoted) / quoted in bps; negative = less than quoted.
diffUsd:
type:
- number
- 'null'
metMinimum:
type:
- boolean
- 'null'
description: received ≥ minimum; null when either is unknown.
fees:
type: object
required:
- feeBps
- fee
- feeUsd
- providerFeeUsd
- gasUsd
properties:
feeBps:
type: integer
description: 'The fee taken from the input, in bps: LayerHop''s plus an integrating partner''s, combined (the split is not public).'
fee:
type: string
description: That fee in input-token base units.
feeUsd:
type:
- number
- 'null'
providerFeeUsd:
type:
- number
- 'null'
description: Provider fee the provider reported at quote time (estimate).
gasUsd:
type:
- number
- 'null'
description: Network gas the provider estimated at quote time.
Error:
type: object
description: Every non-2xx response has this body.
required:
- error
properties:
error:
type: object
required:
- code
- message
- requestId
- docsUrl
properties:
code:
$ref: '#/components/schemas/ErrorCode'
message:
type: string
description: Human-readable detail. Do not parse it.
requestId:
type: string
format: uuid
description: Same value as the `x-request-id` header.
docsUrl:
type: string
format: uri
description: Error catalog page, `https://docs.layerhop.com/errors/{code}`.
details:
type: object
description: 'Extra structured data, only on some errors. `NO_ROUTE` (and `AMOUNT_TOO_SMALL` /
`AMOUNT_TOO_LARGE` decided from the providers'' answers) on a quote carry `errors`: why
each provider returned no quote, the same entries a successful response lists in `errors`.
`AMOUNT_TOO_SMALL` on a quote may also carry the route''s minimum (D-036): `minAmount`,
`minAmountUsd`, `minAmountApprox`. `NO_ROUTE` on a live quote (and `UNSUPPORTED_CHAIN`
into a route-restricted chain such as Blast) may carry `suggestions` (D-053).
'
properties:
errors:
type: array
items:
$ref: '#/components/schemas/ProviderError'
suggestions:
type: array
maxItems: 4
description: '`NO_ROUTE` / `UNSUPPORTED_CHAIN` on a live quote: alternatives that quoted, best first (D-053).'
items:
$ref: '#/components/schemas/RouteSuggestion'
minAmount:
type: string
pattern: ^\d+$
description: '`AMOUNT_TOO_SMALL`: smallest input known to quote on this route, base units of `srcToken`.'
minAmountUsd:
type: number
description: '`AMOUNT_TOO_SMALL`: `minAmount` in USD, when the token has a price.'
minAmountApprox:
type: boolean
description: '`AMOUNT_TOO_SMALL`: `true` when `minAmount` was found by probing larger amounts ($10 / $25 / $50), so the true minimum is at most this; `false` when a provider reported it.'
ErrorCode:
type: string
description: Stable error code. Each has a page at `https://docs.layerhop.com/errors/{code}`.
enum:
- INVALID_PARAMS
- UNSUPPORTED_CHAIN
- UNSUPPORTED_TOKEN
- AMOUNT_TOO_SMALL
- AMOUNT_TOO_LARGE
- CALLS_REVERTED
- LAUNCH_IMAGE_INVALID
- NO_ROUTE
- ROUTE_EXCLUDED
- QUOTE_NOT_FOUND
- QUOTE_EXPIRED
- ORDER_NOT_FOUND
- PROVIDER_ERROR
- PROVIDER_TIMEOUT
- RATE_LIMITED
- QUOTA_EXCEEDED
- UNAUTHORIZED
- FORBIDDEN
- ADDRESS_SANCTIONED
- NOT_FOUND
- CONFLICT
- GASLESS_PENDING
- GASLESS_FAILED
- MARKET_UNAVAILABLE
- LIMIT_ORDER_REJECTED
- INTERNAL
ProviderError:
type: object
description: A provider that failed while the request as a whole succeeded.
required:
- provider
- code
- message
properties:
provider:
$ref: '#/components/schemas/ProviderId'
code:
$ref: '#/components/schemas/ErrorCode'
message:
type: string
FeedTrade:
allOf:
- $ref: '#/components/schemas/TradeCard'
- type: object
required:
- trader
properties:
trader:
type: string
description: The wallet that made the swap (it opted in to the feed).
RouteSuggestion:
description: 'An alternative to a route that returned no quote (D-053). `dst_token`: same payment, another
destination token. `src_token`: same destination token, paid with another source token worth the
same. `via_hub`: two signed steps through `hub` (`steps[0]` then `steps[1]`, each its own quote,
order and signature); the top-level fields describe the whole trip.
'
allOf:
- $ref: '#/components/schemas/RouteLeg'
- type: object
required:
- kind
- message
properties:
kind:
type: string
enum:
- dst_token
- src_token
- via_hub
message:
type: string
description: Short text for a button, e.g. "Receive USDC on Ethereum instead".
symbol:
type: string
description: 'The token that changed: the new source or destination token, or the hub token.'
hub:
type: object
description: '`via_hub` only: the token between the two steps.'
required:
- chainId
- token
- symbol
- decimals
properties:
chainId:
type: integer
token:
type: string
symbol:
type: string
decimals:
type: integer
steps:
type: array
description: '`via_hub` only: the two legs in order.'
minItems: 2
maxItems: 2
items:
$ref: '#/components/schemas/RouteLeg'
ProviderId:
type: string
description: 'Liquidity provider. Loaded by default: `jupiter`, `relay`, `debridge`, `zerox`, `kyberswap`, `lifi`, `mayan`,
`blast-native` (Blast''s canonical bridge: ETH on Ethereum → ETH on Blast only, no LayerHop fee).
`across` (Across Protocol, cross-chain EVM ↔ EVM), `baltex` (Baltex exchanges and DEX swaps), `routefun`
(Route, same-chain), `bebop` (Bebop RFQ and Aggregation, same-chain), `near-intents` (NEAR Intents 1Click),
`thorchain` and `chainflip` (native BTC and other non-EVM routes) `layerhop-solver` (LayerHop''s own solver: USDC between Base,
Arbitrum and OP Mainnet, filled from our inventory) and `layerhop-router` (LayerHop''s own same-chain
router on Robinhood Chain and Berachain) are built but not loaded by default.
`odos` is shut down; `mock` exists only in local
development (`LAYERHOP_ENABLE_MOCK=1`). `sandbox` serves every request made with an `lh_test_` key.
`direct` is a plain token transfer, used by checkout when the payer already holds the settlement token.
'
enum:
- jupiter
- relay
- debridge
- mayan
- zerox
- kyberswap
- odos
- lifi
- blast-native
- across
- baltex
- routefun
- bebop
- near-intents
- thorchain
- chainflip
- layerhop-router
- layerhop-solver
- mock
- sandbox
- direct
ShareTradesRequest:
type: object
required:
- vm
- wallet
- enabled
- issuedAt
- signature
properties:
vm:
$ref: '#/components/schemas/WalletVm'
wallet:
type: string
description: The signing wallet (EVM lowercased in the signed message).
enabled:
type: boolean
description: '`true` = show my swaps in the feed; `false` = stop.'
issuedAt:
type: string
format: date-time
description: '`Date.toISOString()` of when the wallet signed; at most 10 minutes old and newer than the last recorded choice.'
signature:
type: string
description: 'EVM: 0x 65-byte signature. Solana: 64-byte signature, base58 or base64.'
WalletVm:
type: string
enum:
- evm
- svm
description: VM of a wallet that signs in or signs messages (EVM or Solana; Tron wallets can't yet).
RouteLeg:
type: object
description: One quotable leg, in the same terms as a quote request. Amounts are base units.
required:
- srcChain
- srcToken
- amount
- dstChain
- dstToken
properties:
srcChain:
type: integer
description: Source chain id.
srcToken:
type: string
description: 'Source token address or mint (native coin: the zero address; SOL: the system program id).'
amount:
type: string
pattern: ^\d+$
description: Input in base units of `srcToken`.
dstChain:
type: integer
description: Destination chain id.
dstToken:
type: string
dstAmount:
type: string
pattern: ^\d+$
description: Estimated output in base units of `dstToken` (from the check quote; scaled when served from cache).
TradeCard:
type: object
description: A filled live order as public trade data. Never includes a wallet address.
required:
- quoteId
- provider
- srcChainId
- srcToken
- srcSymbol
- srcDecimals
- srcVerified
- srcAmount
- srcAmountUsd
- dstChainId
- dstToken
- dstSymbol
- dstDecimals
- dstVerified
- dstAmount
- dstAmountUsd
- srcTxHash
- srcTxVerified
- dstTxHash
- filledAt
- execution
properties:
quoteId:
type: string
provider:
type: string
description: The route provider that filled it.
srcChainId:
type: integer
srcToken:
type: string
srcSymbol:
type:
- string
- 'null'
description: Token-list symbol; null when the token is unlisted or unknown.
srcDecimals:
type:
- integer
- 'null'
srcVerified:
type: boolean
description: The token is listed (LayerHop's curated list, or verified / popular on a provider list). Show an unlisted token by its address, not a name.
srcAmount:
type: string
description: Input amount in base units.
srcAmountUsd:
type:
- number
- 'null'
description: USD value of the input at fill; null when not recorded or the token is unlisted.
dstChainId:
type: integer
dstToken:
type: string
dstSymbol:
type:
- string
- 'null'
description: Token-list symbol; null when the token is unlisted or unknown.
dstDecimals:
type:
- integer
- 'null'
dstVerified:
type: boolean
description: The token is listed (as `srcVerified`).
dstAmount:
type: string
description: Quoted output amount in base units.
dstAmountUsd:
type:
- number
- 'null'
description: USD value of the output at fill; null when not recorded or the token is unlisted.
srcTxHash:
type:
- string
- 'null'
description: Source transaction. In portfolio trades, null unless the wallet is the sender.
srcTxVerified:
type: boolean
description: The source transaction was checked on chain when reported (sent by the order's sender to the transaction LayerHop built). False when unchecked or unknown.
dstTxHash:
type:
- string
- 'null'
description: Destination transaction. In portfolio trades, null unless the wallet is the recipient.
filledAt:
type: string
format: date-time
execution:
$ref: '#/components/schemas/TradeExecution'
TradeSharing:
type: object
required:
- wallet
- enabled
- since
properties:
wallet:
type: string
enabled:
type: boolean
since:
type:
- string
- 'null'
format: date-time
description: When sharing was turned on; the feed shows swaps filled after it.
responses:
NotFound:
description: The resource does not exist or belongs to another account (`NOT_FOUND`).
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: NOT_FOUND
message: API key not found
requestId: 0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21
docsUrl: https://docs.layerhop.com/errors/NOT_FOUND
Conflict:
description: The request conflicts with existing state (`CONFLICT`).
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: CONFLICT
message: A different txHash was already reported for this order
requestId: 0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21
docsUrl: https://docs.layerhop.com/errors/CONFLICT
BadRequest:
description: 'Invalid request (`INVALID_PARAMS`, `UNSUPPORTED_CHAIN`, `UNSUPPORTED_TOKEN`,
`AMOUNT_TOO_SMALL`, `AMOUNT_TOO_LARGE`).
'
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: INVALID_PARAMS
message: 'amount: amount must be an integer string in base units'
requestId: 0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21
docsUrl: https://docs.layerhop.com/errors/INVALID_PARAMS
Unauthorized:
description: Missing or wrong credentials (`UNAUTHORIZED`).
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: UNAUTHORIZED
message: Invalid admin token
requestId: 0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21
docsUrl: https://docs.layerhop.com/errors/UNAUTHORIZED
TooManyRequests:
description: 'Over your rate limit (`RATE_LIMITED`): the key''s `rateLimitRpm`, or `ANON_RATE_LIMIT_RPM` per IP
without a key. Wait `retry-after` seconds.
'
headers:
x-request-id:
$ref: '#/components/headers/RequestId'
retry-after:
description: Seconds until a request will be accepted.
schema:
type: integer
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
error:
code: RATE_LIMITED
message: Rate limit of 120 requests/minute exceeded; retry in 1s
requestId: 0d5e1f6a-3b2c-4d1e-8f9a-7b6c5d4e3f21
docsUrl: https://docs.layerhop.com/errors/RATE_LIMITED
headers:
RequestId:
description: Unique id for this request. Quote it when you report a problem.
schema:
type: string
format: uuid
securitySchemes:
ApiKey:
type: apiKey
in: header
name: x-api-key
description: 'Optional. An `lh_live_…` key from the dashboard attributes requests and orders to your account
and raises your rate limit (per key, default 120 requests/minute; without a key the limit is
per IP). An invalid or revoked key is rejected with `UNAUTHORIZED`. If your account has an
active partner profile, the key selects your partner fee and allows `integratorFeeBps`.
An `lh_test_…` key switches every request to **test mode**: quotes come from the `sandbox`
provider (priced from live USD prices), built transactions are placeholders that move no funds
(`tx.sandbox: true`), and reported orders run a simulated lifecycle (pending, then filled in about
10 seconds) with webhooks sent to your test endpoints only. Amounts ending in `4001` refund,
`4002` fail and `4004` return `NO_ROUTE`. Test and live data never mix: a quote, order or
webhook of one mode is invisible to the other.
'
Session:
type: apiKey
in: cookie
name: lh_session
description: 'Dashboard session cookie set by `POST /v1/auth/verify` (HttpOnly, Secure, SameSite=Lax,
7 days). Auth and Dashboard routes only.
'
AdminBearer:
type: http
scheme: bearer
description: Operator `ADMIN_TOKEN`. Admin routes only.
AdminSession:
type: apiKey
in: cookie
name: lh_admin
description: Owner sign-in cookie set by `POST /v1/admin/login` (12 hours). Admin routes only.
x-refined-from:
- layerhop-com-openapi.yaml
- openapi.yaml