HTTP API

Generate token by following this Generating Private Key

Start a project scan

POST https://api.solidityscan.com/private/api-project-scan/

Name
Type
Description

Authorization*

String

Bearer <token>

Request Body

Name
Type
Description

project_url*

string

url of the project

project_branch

string

branch of the repository to scan

skip_file_paths

[string]

list of paths to skip when scanning

rescan

boolean

true if this scan has already been scanned, false if not.

Project Scan Example

curl --location 'https://api.solidityscan.com/private/api-project-scan/' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-origin' \
--header 'sec-gpc: 1' \
--header 'Authorization: Bearer <Your Token>' \
--header 'Content-Type: application/json' \
--data '{
    "provider": "github",
    "project_name": "SolidityScan",
    "project_url": "https://github.com/Shashank-In/SmartContract",
    "project_branch": "main",
    "project_skip_files":[]
}'

Verified Contract Scans

Start a block scan

POST https://api.solidityscan.com/private/api-start-scan-block/

Name
Type
Description

Authorization*

String

Bearer <token>

Request Body

Name
Type
Description

contract_address*

string

address of the contract

contract_platform*

string

contract_chain*

strin

chain which the contract belongs to

Block Scan CURL Example

curl --location 'https://api.solidityscan.com/private/api-start-scan-block/' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-origin' \
--header 'sec-gpc: 1' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "contract_address": "0x814d65082Bbfbf45130741018772143b690609CE",
    "contract_platform": "bscscan",
    "contract_chain": "mainnet"
}'

Generate Report

Generate Report

POST https://api.solidityscan.com/private/api-generate-report/

Request Headers

Name
Type
Description

Authorization*

String

Bearer <token>

Request Body

Name
Type
Description

project_id*

string

project_id to generate report for

scan_id*

string

id of the scan associated

scan_type

string

block | project (Use block scan when generating report of scanned on-chain contract and use project type when generating report of github or file upload)

Generate Report CURL Example

curl --location 'https://api.solidityscan.com/private/api-generate-report/' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-origin' \
--header 'sec-gpc: 1' \
--header 'Authorization: Bearer <Your Token Here>' \
--header 'Content-Type: application/json' \
--data '{
    "project_id": "6571b352c270c4eafcd0c8b09a75aebc",
    "scan_id": "2934f6851ea514ee",
    "scan_type":"project"
}'

Pre-Signed URL Generation

GEThttps://solidityscan.com/app/private/api-get-presigned-url/

Generates a pre-signed URL for uploading a file (e.g., test.sol).

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Response

{
    "status": "success",
    "result": {
        "url": "<URL_OF_THE_FILE>"
    }
}

Curl Example:

curl --location 'https://solidityscan.com/app/private/api-get-presigned-url/?file_name=test.sol' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-GB,en-US;q=0.9,en;q=0.8' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--data ''

Scan Retrieval

POSThttps://solidityscan.com/app/private/api-get-scan/

Fetches the scan result of a specific project or file.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

client_id

number

Id of the client

scan_id

string

Id of the scan

scan_type

string

Type of Scan

project_id

string

Id of the project

Response

{
  "scan_report": {
    "file_url_list": [
      "https://credshields-prod.s3.amazonaws.com/temp_backend/15c9c621-11ab-4db5-a005-4c98ebbad1d9/1736928326545_testnew.sol"
    ],
    "is_quick_scan": false,
    "multi_file_scan_details": [
      {
        "issue_id": "SOLIDITY_INCORRECT_ACCESS_CONTROL",
        "metric_wise_aggregated_findings": [
          {
            "bug_hash": "mUvFpuKREc_hKplmSXj99sLGIzg=",
            "bug_id": "SSP_51519_14",
            "bug_status": "pending_fix",
            "description_details": {
              "contract_name": "BUG",
              "function_name": "transferToken",
              "library_name": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol",
              "modifier_name": "onlyOwner"
            },
            "findings": [
              {
                "ai_tagged_reason": "The function 'transferToken' has a require statement checking the balance of msg.sender and ensures the recipient address is not zero. It does not modify critical data without proper checks, and it operates on the balance of msg.sender, which is appropriate for a public function.",
                "ai_tagged_status": false,
                "file_path": "/testnew.sol",
                "line_nos_end": [
                  27
                ],
                "line_nos_start": [
                  22
                ]
              }
            ],
            "scan_id": "759bab4e4c214fc5"
          }
        ],
        "no_of_findings": 1,
        "template_details": {
          "description_keys": [
            "contract_name",
            "library_name",
            "function_name",
            "modifier_name"
          ],
          "issue_confidence": "1",
          "issue_description": "<p>Access control plays an important role in segregation of privileges in smart contracts and other applications. If this is misconfigured or not properly validated on sensitive functions, it may lead to loss of funds, tokens and in some cases compromise of the smart contract. <br><br>The contract ${contract_name} is importing an access control library ${library_name} but the function ${function_name} is missing the modifier ${modifier_name}.</p>",
          "issue_id": "SOLIDITY_INCORRECT_ACCESS_CONTROL",
          "issue_name": "INCORRECT ACCESS CONTROL",
          "issue_remediation": "<p>It is recommended to go through the contract and observe the functions that are lacking an access control modifier. If they contain sensitive administrative actions, it is advised to add a suitable modifier to the same</p>",
          "issue_severity": "critical",
          "issue_status": "true",
          "static_issue_description": "<p>Access control plays an important role in the segregation of privileges in smart contracts and other applications. If this is misconfigured or not properly validated on sensitive functions, it may lead to loss of funds, tokens and in some cases compromise of the smart contract. <br><br>The contract is importing an access control library but the function is missing the modifier.</p>"
        }
      },
.......

Curl Example:

curl --location 'https://solidityscan.com/app/private/api-get-scan/' \
--header 'accept: application/json, text/plain, */*' \
--header 'content-type: application/json' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--data '{
    "client_id": 802,
    "scan_id": "789e422d9923edd3",
    "scan_type": "block",
    "project_id": "09577d722c51953c21e0a41199c47699"
}'

File Scan

POSThttps://solidityscan.com/app/private/api-file-scan/

Uploads a file and initiates its scan.

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Description

file_urls

array

An array containing all the URLs of the files.

project_name

string

Name of the project

project_type

string

Type of the project

Response

{
  "scan_report": {
    "file_url_list": [
      "https://credshields-prod.s3.amazonaws.com/temp_backend/15c9c621-11ab-4db5-a005-4c98ebbad1d9/1736928326545_testnew.sol"
    ],
    "is_quick_scan": false,
    "multi_file_scan_details": [
      {
        "issue_id": "SOLIDITY_INCORRECT_ACCESS_CONTROL",
        "metric_wise_aggregated_findings": [
          {
            "bug_hash": "mUvFpuKREc_hKplmSXj99sLGIzg=",
            "bug_id": "SSP_51519_14",
            "bug_status": "pending_fix",
            "description_details": {
              "contract_name": "BUG",
              "function_name": "transferToken",
              "library_name": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol",
              "modifier_name": "onlyOwner"
            },
            "findings": [
              {
                "ai_tagged_reason": "The function 'transferToken' has a require statement checking the balance of msg.sender and ensures the recipient address is not zero. It does not modify critical data without proper checks, and it operates on the balance of msg.sender, which is appropriate for a public function.",
                "ai_tagged_status": false,
                "file_path": "/testnew.sol",
                "line_nos_end": [
                  27
                ],
                "line_nos_start": [
                  22
                ]
              }
            ],
            "scan_id": "759bab4e4c214fc5"
          }
        ],
        "no_of_findings": 1,
        "template_details": {
          "description_keys": [
            "contract_name",
            "library_name",
            "function_name",
            "modifier_name"
          ],
          "issue_confidence": "1",
          "issue_description": "<p>Access control plays an important role in segregation of privileges in smart contracts and other applications. If this is misconfigured or not properly validated on sensitive functions, it may lead to loss of funds, tokens and in some cases compromise of the smart contract. <br><br>The contract ${contract_name} is importing an access control library ${library_name} but the function ${function_name} is missing the modifier ${modifier_name}.</p>",
          "issue_id": "SOLIDITY_INCORRECT_ACCESS_CONTROL",
          "issue_name": "INCORRECT ACCESS CONTROL",
          "issue_remediation": "<p>It is recommended to go through the contract and observe the functions that are lacking an access control modifier. If they contain sensitive administrative actions, it is advised to add a suitable modifier to the same</p>",
          "issue_severity": "critical",
          "issue_status": "true",
          "static_issue_description": "<p>Access control plays an important role in the segregation of privileges in smart contracts and other applications. If this is misconfigured or not properly validated on sensitive functions, it may lead to loss of funds, tokens and in some cases compromise of the smart contract. <br><br>The contract is importing an access control library but the function is missing the modifier.</p>"
        }
      },
.......

Last updated