{
  "openapi": "3.1.0",
  "info": {
    "title": "Safe or Scam — crypto safety & agent data API",
    "version": "2.0.0",
    "description": "Pay-per-call tools for AI agents: crypto token, website and wallet scam checks; blockchain reads (balances, transactions, token info) on 8 chains; web page to clean Markdown; email address checks.",
    "x-guidance": "Before buying a token, connecting a wallet to a site, or sending funds to an address, call the matching /api/check/* endpoint. verdict 'red' = likely scam (do not proceed), 'yellow' = caution, 'green' = no major red flags (not a guarantee). Use /api/chain/* for on-chain reads, /api/read to turn a URL into Markdown, /api/check/email to validate an email. Pay per call in USDC on Base via x402, or send a prepaid key in X-API-Key (packs at /#buy; 1 credit per call on any endpoint). Free for humans: the GET versions (3/day). Inputs are validated before payment; failed fetches are not charged."
  },
  "servers": [
    {
      "url": "https://scam-check.safe-or-scam.workers.dev"
    }
  ],
  "paths": {
    "/api/check/token": {
      "post": {
        "operationId": "check_token",
        "summary": "Token scam check: honeypot, taxes, mint/freeze, whales, liquidity lock",
        "description": "Is this crypto token a scam? Honeypot buy/sell simulation, hidden taxes, mint/freeze authority, hidden owner, blacklist, whale concentration, liquidity lock. Returns red/yellow/green with reasons. EVM chains + Solana.",
        "tags": [
          "Security"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Token contract address (0x...) or Solana mint"
                  },
                  "chain": {
                    "type": "string",
                    "enum": [
                      "ethereum",
                      "bsc",
                      "base",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "solana"
                    ],
                    "description": "Chain: ethereum, bsc, base, arbitrum, polygon, optimism, avalanche, solana"
                  }
                },
                "required": [
                  "address",
                  "chain"
                ]
              },
              "example": {
                "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "chain": "base"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "green",
                        "yellow",
                        "red"
                      ],
                      "description": "red = likely scam, yellow = caution, green = no major red flags"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "red_flags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "good_signs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "data": {
                      "type": "object"
                    },
                    "checked_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "verdict",
                    "summary",
                    "red_flags",
                    "warnings"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (you are not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Source unavailable (you are not charged)"
          }
        }
      }
    },
    "/api/check/site": {
      "post": {
        "operationId": "check_website",
        "summary": "Website scam check: phishing lists, domain age, fake brands, seed-phrase requests",
        "description": "Is this website a crypto scam or phishing page? Phishing databases, domain age, look-alikes of 45+ crypto brands (MetaMask, Phantom, Binance...), seed-phrase requests, wallet-drainer code. Returns red/yellow/green with reasons.",
        "tags": [
          "Security"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Website address, e.g. example.com or https://example.com/path"
                  }
                },
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "metamask-wallet-restore.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "green",
                        "yellow",
                        "red"
                      ],
                      "description": "red = likely scam, yellow = caution, green = no major red flags"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "red_flags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "good_signs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "data": {
                      "type": "object"
                    },
                    "checked_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "verdict",
                    "summary",
                    "red_flags",
                    "warnings"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (you are not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Source unavailable (you are not charged)"
          }
        }
      }
    },
    "/api/check/wallet": {
      "post": {
        "operationId": "check_wallet",
        "summary": "Wallet address check: scam/phishing/sanctions links, risky token approvals, contract vs wallet",
        "description": "Is it safe to send crypto to this address, and is this wallet exposed? Checks scam, phishing, theft, sanctions and mixer links; risky or malicious token approvals (who can drain the wallet); contract vs personal wallet; brand-new 'poisoned' look-alike addresses. Returns red/yellow/green with reasons. EVM chains + Solana.",
        "tags": [
          "Security"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Wallet address (0x...) or Solana address"
                  },
                  "chain": {
                    "type": "string",
                    "enum": [
                      "ethereum",
                      "bsc",
                      "base",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "solana"
                    ],
                    "description": "Chain: ethereum, bsc, base, arbitrum, polygon, optimism, avalanche, solana"
                  }
                },
                "required": [
                  "address",
                  "chain"
                ]
              },
              "example": {
                "address": "0xbf39c5cc183d58c0b440df8b8d33dbe7996a7679",
                "chain": "base"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "verdict": {
                      "type": "string",
                      "enum": [
                        "green",
                        "yellow",
                        "red"
                      ],
                      "description": "red = likely scam, yellow = caution, green = no major red flags"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "red_flags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "good_signs": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "data": {
                      "type": "object"
                    },
                    "checked_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "verdict",
                    "summary",
                    "red_flags",
                    "warnings"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (you are not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Source unavailable (you are not charged)"
          }
        }
      }
    },
    "/api/chain/balances": {
      "post": {
        "operationId": "get_wallet_balances",
        "summary": "Wallet balances: native coin + tokens (EVM chains and Solana)",
        "description": "Get a wallet's balances: native coin (ETH, BNB, POL, AVAX, SOL) and tokens. Solana: every SPL token held. EVM: popular tokens on the chain plus any token addresses you pass. Also returns transactions sent and whether the address is a contract.",
        "tags": [
          "Blockchain data"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Wallet address (0x...) or Solana address"
                  },
                  "chain": {
                    "type": "string",
                    "enum": [
                      "ethereum",
                      "bsc",
                      "base",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "solana"
                    ],
                    "description": "Chain: ethereum, bsc, base, arbitrum, polygon, optimism, avalanche, solana"
                  },
                  "tokens": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Optional extra EVM token addresses to include (max 20)"
                  }
                },
                "required": [
                  "address",
                  "chain"
                ]
              },
              "example": {
                "address": "0xbf39c5cc183d58c0b440df8b8d33dbe7996a7679",
                "chain": "base"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "address": {
                      "type": "string",
                      "description": ""
                    },
                    "chain": {
                      "type": "string",
                      "description": ""
                    },
                    "native": {
                      "type": "object"
                    },
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "transactions_sent": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "address",
                    "native",
                    "tokens"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (you are not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Source unavailable (you are not charged)"
          }
        }
      }
    },
    "/api/chain/tx": {
      "post": {
        "operationId": "get_transaction",
        "summary": "Transaction lookup: status, fee, token transfers, approvals (EVM chains and Solana)",
        "description": "Look up a transaction by hash: success/failed/pending, confirmations, time, sender, receiver, value, fee, method, decoded token and NFT transfers, and token approvals it granted (flags unlimited approvals). Solana: balance changes per account.",
        "tags": [
          "Blockchain data"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hash": {
                    "type": "string",
                    "description": "Transaction hash (0x...) or Solana signature"
                  },
                  "chain": {
                    "type": "string",
                    "enum": [
                      "ethereum",
                      "bsc",
                      "base",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "solana"
                    ],
                    "description": "Chain: ethereum, bsc, base, arbitrum, polygon, optimism, avalanche, solana"
                  }
                },
                "required": [
                  "hash",
                  "chain"
                ]
              },
              "example": {
                "hash": "0x5c504ed432cb51138bcf09aa5e8a410dd4a1e204ef84bfed1be16dfba1b22060",
                "chain": "ethereum"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "success",
                        "failed",
                        "pending",
                        "not_found"
                      ]
                    },
                    "summary": {
                      "type": "string",
                      "description": ""
                    },
                    "from": {
                      "type": "string",
                      "description": ""
                    },
                    "to": {
                      "type": "string",
                      "description": ""
                    },
                    "fee": {
                      "type": "string",
                      "description": ""
                    },
                    "token_transfers": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "approvals": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "status",
                    "summary"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (you are not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Source unavailable (you are not charged)"
          }
        }
      }
    },
    "/api/chain/token": {
      "post": {
        "operationId": "get_token_info",
        "summary": "Token info: name, symbol, decimals, total supply (Solana: mint/freeze authority)",
        "description": "Read a token's on-chain details: name, symbol, decimals, total supply. Solana: supply, decimals, mint authority and freeze authority.",
        "tags": [
          "Blockchain data"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "type": "string",
                    "description": "Token contract address (0x...) or Solana mint"
                  },
                  "chain": {
                    "type": "string",
                    "enum": [
                      "ethereum",
                      "bsc",
                      "base",
                      "arbitrum",
                      "polygon",
                      "optimism",
                      "avalanche",
                      "solana"
                    ],
                    "description": "Chain: ethereum, bsc, base, arbitrum, polygon, optimism, avalanche, solana"
                  }
                },
                "required": [
                  "address",
                  "chain"
                ]
              },
              "example": {
                "address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
                "chain": "base"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "found": {
                      "type": "boolean"
                    },
                    "name": {
                      "type": "string",
                      "description": ""
                    },
                    "symbol": {
                      "type": "string",
                      "description": ""
                    },
                    "decimals": {
                      "type": "number"
                    },
                    "total_supply": {
                      "type": "string",
                      "description": ""
                    }
                  },
                  "required": [
                    "found"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (you are not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Source unavailable (you are not charged)"
          }
        }
      }
    },
    "/api/read": {
      "post": {
        "operationId": "read_webpage",
        "summary": "Web page to clean Markdown for LLMs (no menus, ads or scripts)",
        "description": "Fetch any public web page and return clean Markdown of its main content (headings, lists, links, code), plus title and description. Strips menus, footers, ads and scripts so it is ready for an LLM. Not charged if the page can't be fetched.",
        "tags": [
          "Web"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Page address, e.g. https://example.com/article"
                  },
                  "max_chars": {
                    "type": "number",
                    "description": "Max characters to return (500-100000, default 20000)"
                  }
                },
                "required": [
                  "url"
                ]
              },
              "example": {
                "url": "https://en.wikipedia.org/wiki/Stablecoin"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "description": ""
                    },
                    "markdown": {
                      "type": "string",
                      "description": ""
                    },
                    "words": {
                      "type": "number"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "final_url": {
                      "type": "string",
                      "description": ""
                    }
                  },
                  "required": [
                    "markdown"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (you are not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Source unavailable (you are not charged)"
          }
        }
      }
    },
    "/api/check/email": {
      "post": {
        "operationId": "check_email",
        "summary": "Email address check: format, domain accepts mail (MX), disposable, typos, role address",
        "description": "Check an email address before sending or signing someone up: valid format, domain exists and accepts mail (MX), throwaway/disposable domain, typo suggestions (gmial.com → gmail.com), role addresses (info@, support@), SPF/DMARC. Returns valid / risky / invalid with reasons.",
        "tags": [
          "Email"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.002000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Email address to check"
                  }
                },
                "required": [
                  "email"
                ]
              },
              "example": {
                "email": "someone@gmial.com"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "valid",
                        "risky",
                        "invalid"
                      ]
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "can_receive_mail": {
                      "type": "boolean"
                    },
                    "disposable": {
                      "type": "boolean"
                    },
                    "did_you_mean": {
                      "type": "string",
                      "description": ""
                    }
                  },
                  "required": [
                    "status",
                    "reasons"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (you are not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Source unavailable (you are not charged)"
          }
        }
      }
    }
  }
}