{
  "openapi": "3.1.0",
  "servers": [
    {
      "url": "https://base-intel-api.jakemaxsigal.workers.dev"
    }
  ],
  "info": {
    "title": "Base Intel API",
    "version": "1.0.0",
    "description": "Pay-per-call x402 APIs for AI agents on Base: live web search, new-token rug-check, DeFi yields, gas oracle, wallet scoring, hot DEX pools, and a smart-money leaderboard.",
    "x-guidance": "Paid x402 endpoints, USDC on Base. GET /search?q=... for live web search; GET /bankr/score for new-token rug-check scoring. Each call returns 402 with x402 payment details; pay per call."
  },
  "paths": {
    "/yields": {
      "get": {
        "operationId": "yields",
        "summary": "Base yield API / best APY on Base / DeFi yield aggregator / stablecoin yield finder / lending APY / LP yield",
        "description": "Base yield API / best APY on Base / DeFi yield aggregator / stablecoin yield finder / lending APY / LP yield. Quality-filtered live yields across Base lending markets (Morpho, Moonwell — no impermanent-loss risk) and DEX LP pools, with a best-per-asset recommendation and per-pool risk scoring. For AI agents, yield optimizers, and treasury bots allocating capital on Base.",
        "tags": [
          "defi"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timestamp": {
                      "type": "string"
                    },
                    "chain": {
                      "type": "string"
                    },
                    "bestByAsset": {
                      "type": "object",
                      "properties": {
                        "USDC": {
                          "type": "object",
                          "properties": {
                            "protocol": {
                              "type": "string"
                            },
                            "pool": {
                              "type": "string"
                            },
                            "apy": {
                              "type": "number"
                            },
                            "tvlUsd": {
                              "type": "number"
                            },
                            "recommendation": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "lending": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "protocol": {
                            "type": "string"
                          },
                          "pool": {
                            "type": "string"
                          },
                          "apy": {
                            "type": "number"
                          },
                          "tvlUsd": {
                            "type": "number"
                          },
                          "ilRisk": {
                            "type": "string"
                          },
                          "riskScore": {
                            "type": "number"
                          }
                        }
                      }
                    },
                    "lp": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "protocol": {
                            "type": "string"
                          },
                          "pool": {
                            "type": "string"
                          },
                          "apy": {
                            "type": "number"
                          },
                          "tvlUsd": {
                            "type": "number"
                          },
                          "ilRisk": {
                            "type": "string"
                          },
                          "riskScore": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    },
    "/bankr/score": {
      "get": {
        "operationId": "bankr_score",
        "summary": "Base token launch score / memecoin risk API / new token rug-check / token launch quality grade / token safety score",
        "description": "Base token launch score / memecoin risk API / new token rug-check / token launch quality grade / token safety score. Scores fresh token launches on Base 0-100 with deployer identity, social signals, token age, and a risk grade (lower/medium/higher). For AI trading agents and traders screening new Base tokens before buying.",
        "tags": [
          "trading"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.008000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timestamp": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "launches": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "tokenName": {
                            "type": "string"
                          },
                          "tokenSymbol": {
                            "type": "string"
                          },
                          "tokenAddress": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          },
                          "grade": {
                            "type": "string"
                          },
                          "risk": {
                            "type": "string"
                          },
                          "deployer": {
                            "type": "string"
                          },
                          "ageHours": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Number of recent Base token launches to score (1-50, default 10)."
          }
        ]
      }
    },
    "/pools/hot": {
      "get": {
        "operationId": "pools_hot",
        "summary": "Base DEX pool API / hot liquidity pools on Base / Aerodrome and Uniswap pool screener / trending pools / LP opportunity ",
        "description": "Base DEX pool API / hot liquidity pools on Base / Aerodrome and Uniswap pool screener / trending pools / LP opportunity finder. Ranks top Base DEX pools by sustainable volume and separates healthy pools from pump/wash-trade pools using volume-to-TVL ratios. For AI trading agents and liquidity providers on Base.",
        "tags": [
          "defi"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timestamp": {
                      "type": "string"
                    },
                    "chain": {
                      "type": "string"
                    },
                    "healthy": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "protocol": {
                            "type": "string"
                          },
                          "pair": {
                            "type": "string"
                          },
                          "tvlUsd": {
                            "type": "number"
                          },
                          "volumeUsd24h": {
                            "type": "number"
                          },
                          "feeApr": {
                            "type": "number"
                          },
                          "volTvlRatio": {
                            "type": "number"
                          },
                          "sustainability": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "degen": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "protocol": {
                            "type": "string"
                          },
                          "pair": {
                            "type": "string"
                          },
                          "tvlUsd": {
                            "type": "number"
                          },
                          "volumeUsd24h": {
                            "type": "number"
                          },
                          "volTvlRatio": {
                            "type": "number"
                          },
                          "sustainability": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    },
    "/wallet/score": {
      "get": {
        "operationId": "wallet_score",
        "summary": "Base wallet score API / wallet reputation / address risk scoring / onchain wallet intelligence / counterparty check",
        "description": "Base wallet score API / wallet reputation / address risk scoring / onchain wallet intelligence / counterparty check. Returns a 0-100 activity score with letter grade, smart-wallet (ERC-4337) detection, ETH and USDC balances, recent USDC flow, and a user profile for any Base address. For AI agents, fraud screening, and KYC/counterparty checks.",
        "tags": [
          "data"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.005000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string"
                    },
                    "score": {
                      "type": "number"
                    },
                    "grade": {
                      "type": "string"
                    },
                    "profile": {
                      "type": "string"
                    },
                    "isSmartWallet": {
                      "type": "boolean"
                    },
                    "breakdown": {
                      "type": "object",
                      "properties": {
                        "txCount": {
                          "type": "number"
                        },
                        "activityScore": {
                          "type": "number"
                        },
                        "usdcBalance": {
                          "type": "number"
                        }
                      }
                    },
                    "timestamp": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    },
    "/gas": {
      "get": {
        "operationId": "gas",
        "summary": "Base gas oracle / Base gas price API / Base L2 gas fee tracker / real-time gas estimator / swap cost estimator",
        "description": "Base gas oracle / Base gas price API / Base L2 gas fee tracker / real-time gas estimator / swap cost estimator. Returns the current Base fee, fast/standard/slow priority tiers, the USD cost of a typical swap, and a congestion recommendation. For AI agents, trading bots, and wallets timing transactions on Base to minimize gas.",
        "tags": [
          "infra"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timestamp": {
                      "type": "string"
                    },
                    "chain": {
                      "type": "string"
                    },
                    "baseFeeGwei": {
                      "type": "number"
                    },
                    "tiers": {
                      "type": "object",
                      "properties": {
                        "slow": {
                          "type": "object",
                          "properties": {
                            "maxFeeGwei": {
                              "type": "number"
                            },
                            "waitBlocks": {
                              "type": "number"
                            },
                            "swapCostUsd": {
                              "type": "number"
                            }
                          }
                        },
                        "standard": {
                          "type": "object",
                          "properties": {
                            "maxFeeGwei": {
                              "type": "number"
                            },
                            "waitBlocks": {
                              "type": "number"
                            },
                            "swapCostUsd": {
                              "type": "number"
                            }
                          }
                        },
                        "fast": {
                          "type": "object",
                          "properties": {
                            "maxFeeGwei": {
                              "type": "number"
                            },
                            "waitBlocks": {
                              "type": "number"
                            },
                            "swapCostUsd": {
                              "type": "number"
                            }
                          }
                        }
                      }
                    },
                    "recommendation": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    },
    "/leaderboard": {
      "get": {
        "operationId": "leaderboard",
        "summary": "Base trader leaderboard API / smart money tracker / top Base wallets by USDC flow / onchain whale tracker / copy-trading",
        "description": "Base trader leaderboard API / smart money tracker / top Base wallets by USDC flow / onchain whale tracker / copy-trading signal. Ranks the most active Base wallets by net USDC flow, flagging smart wallets (ERC-4337), accumulators, and pass-through routers. For AI agents and copy-trading bots following smart money on Base.",
        "tags": [
          "data"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "timestamp": {
                      "type": "string"
                    },
                    "chain": {
                      "type": "string"
                    },
                    "period": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "walletsTracked": {
                          "type": "number"
                        },
                        "accumulators": {
                          "type": "number"
                        },
                        "distributors": {
                          "type": "number"
                        },
                        "totalNetFlowUsd": {
                          "type": "number"
                        }
                      }
                    },
                    "leaderboard": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "rank": {
                            "type": "number"
                          },
                          "address": {
                            "type": "string"
                          },
                          "isSmartWallet": {
                            "type": "boolean"
                          },
                          "usdcNetFlowUsd": {
                            "type": "number"
                          },
                          "currentPortfolioUsd": {
                            "type": "number"
                          },
                          "classification": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "search",
        "summary": "Web search for AI agents: search the web for current, real-time info to answer questions, research topics, and ground LL",
        "description": "Web search for AI agents: search the web for current, real-time info to answer questions, research topics, and ground LLM responses with cited sources. Returns ranked, de-duplicated results (title, URL, snippet, source, date, extra RAG context) and top news. Supports recency filter (day/week/month/year), site filter, and pagination. Also: internet search API, live web search, news search, fact lookup, web grounding, RAG retrieval. Usage: GET /search?q=...&recency=week&site=arxiv.org.",
        "tags": [
          "search"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.015000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "count": {
                      "type": "number"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "age": {
                            "type": "string"
                          },
                          "published": {
                            "type": "string"
                          },
                          "extra_snippets": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "news": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "age": {
                            "type": "string"
                          },
                          "published": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "provider": {
                      "type": "string"
                    },
                    "timestamp": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The search query or question to look up on the web."
          },
          {
            "name": "count",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Number of web results to return, 1-10 (default 5)."
          },
          {
            "name": "recency",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Filter to recent results: day, week, month, or year."
          },
          {
            "name": "site",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Restrict results to one domain, e.g. site=arxiv.org."
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            },
            "description": "Pagination offset, 0-9 (for fetching further result pages)."
          }
        ]
      }
    },
    "/token/check": {
      "get": {
        "operationId": "token_check",
        "summary": "Base token safety check / rug-check API / honeypot & scam token detector / ERC-20 contract risk score / token due dilige",
        "description": "Base token safety check / rug-check API / honeypot & scam token detector / ERC-20 contract risk score / token due diligence. Given any Base token address, returns a 0-100 safety score and grade with flags: ownership renounced?, upgradeable proxy?, valid ERC-20?, plus name, symbol, decimals and supply. For AI trading agents and wallets screening a token before swapping or approving. Usage: GET /token/check?address=0x...",
        "tags": [
          "trading"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string"
                    },
                    "isContract": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "decimals": {
                      "type": "number"
                    },
                    "totalSupply": {
                      "type": "string"
                    },
                    "ownershipRenounced": {
                      "type": "boolean"
                    },
                    "isUpgradeableProxy": {
                      "type": "boolean"
                    },
                    "safetyScore": {
                      "type": "number"
                    },
                    "grade": {
                      "type": "string"
                    },
                    "riskLevel": {
                      "type": "string"
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "note": {
                      "type": "string"
                    },
                    "timestamp": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "402": {
            "description": "Payment Required"
          }
        },
        "parameters": [
          {
            "name": "address",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The Base token contract address to check, e.g. 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913."
          }
        ]
      }
    },
    "/health": {
      "get": {
        "operationId": "health_check",
        "security": [],
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "operationId": "openapi",
        "security": [],
        "summary": "OpenAPI document",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  }
}