{
  "openapi": "3.1.0",
  "info": {
    "title": "Get Contract Source Code",
    "version": "2.0.0",
    "description": "Retrieve the source code for a verified smart contract.",
    "license": {
      "name": "Etherscan API Terms",
      "url": "https://etherscan.io/terms"
    }
  },
  "servers": [
    {
      "url": "https://api.etherscan.io",
      "description": "Etherscan API."
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/v2/api": {
      "get": {
        "operationId": "getGetsourcecode",
        "summary": "Get Contract Source Code",
        "description": "Retrieve the source code for a verified smart contract.",
        "parameters": [
          {
            "name": "chainid",
            "in": "query",
            "required": true,
            "description": "Chain ID to query, eg 1 for Ethereum, 8453 for Base from our supported chains.",
            "schema": {
              "type": "string"
            },
            "example": "1"
          },
          {
            "name": "module",
            "in": "query",
            "required": true,
            "description": "Set to contract for this endpoint.",
            "schema": {
              "type": "string",
              "default": "contract"
            },
            "example": "contract"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "description": "Set to getsourcecode for this endpoint.",
            "schema": {
              "type": "string",
              "default": "getsourcecode"
            },
            "example": "getsourcecode"
          },
          {
            "name": "address",
            "in": "query",
            "required": true,
            "description": "The contract address to query.",
            "schema": {
              "type": "string"
            },
            "example": "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-mint": {
          "metadata": {
            "title": "Get Contract Source Code",
            "description": "Retrieve the source code for a verified smart contract."
          }
        },
        "x-etherscan-source-page": {
          "page": "api-reference/endpoint/getsourcecode",
          "title": "Get Contract Source Code",
          "module": "contract",
          "action": "getsourcecode"
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "query",
        "name": "apikey",
        "description": "Your Etherscan API key."
      }
    }
  }
}