# Similarityscan

<mark style="color:green;">`POST`</mark> `https://www.coinscope.co/api/search/similarity`

Creates an automated audit report and similarity analysis for an address or a source code.\
Example:\
<https://www.cyberscope.io/cyberscan?address=0xd41c4805a9a3128f9f7a7074da25965371ba50d5&chainId=56>

#### Request Body

| Name                                   | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                             |
| -------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| type<mark style="color:red;">\*</mark> | String | <p><code>address</code> or <code>source</code>.<br>Specifies if the Cyberscan will run in a deployed address or a source code.</p>                                                                                                                                                                                                                                                                                      |
| address                                | String | <p>Applied if <code>type=address</code></p><p>An EVM compatible address. e.g.  <code>0xd41c4805a9a3128f9f7a7074da25965371ba50d5</code></p>                                                                                                                                                                                                                                                                              |
| chainId                                | Number | <p>Applied if <code>type=address</code><br>The id of the chain that the address is deployed.<br>1 (ETH), 56 (BSC), 137 (MATIC), 43114 (AVAX), 25 (CRO), 2000 (DOGE), 1666600000 (ONE), 250 (FTM), 1285 (MOVR), 1284 (GLMR), 42220 (CELO), 42161 (ARBITRUM), 61 (ETC), 10 (OPTIMISM), 100 (XDAI), 5 (GOERLI), 97 (BSC\_TESTNET), 80001 (POLYGON\_MUMBAI), 4 (RINKEBY), 3 (ROPSTEN), 42 (KOVAN), 321 (KCC), 106 (VLX)</p> |
| source                                 | String | <p>Applied if <code>type=source</code><br>The source code of a smart contract.</p>                                                                                                                                                                                                                                                                                                                                      |

{% tabs %}
{% tab title="200: OK The response contains 2 fields. "ranks" is the similarity with the entire contract, "contracts" is the similarity with a segment of the contract" %}

````json
```json
{
  "ranks": [
    {
      "score": 0.9059958539307925, // Similarity score, 1 is identical
      "origin": "dxsale", // The platform that the source code belongs
      "file": "LiquidityGeneratorToken.sol"  // The name of the file
    },
    {
      "score": 0.8868468468468469,
      "origin": "dxsale",
      "file": "DxFeeToken.sol"
    },
  ],
  "contracts": [
    {
      "name": "IUniswapV2Factory", // The name of the contract/interface in the source code that matches
      "start": 18993, // The index of the contract that the similarity starts
      "end": 19745, // The index of the contract that the similarity finishes
      "score": 0.9850187265917603, // Similarity score, 1 is identical
      "origin": "uniswap", // The platform that the source code belongs
      "file": "IUniswapV2Factory.sol" // The name of the file
    },
    {
      "name": "IERC20",
      "start": 718,
      "end": 3391,
      "score": 0.9611562782294489,
      "origin": "oppenzeppelin",
      "file": "IERC20.sol"
    }
  ],
  "source": "the source code" // the source if type="address" is applied
}

```
````

{% endtab %}

{% tab title="400: Bad Request If type=address and the address does not belong to an ERC20 applicable coin" %}

```json
{
    "message": "notContract" // notContract or address
}
```

{% endtab %}
{% endtabs %}
