# REST APIs

### Base Endpoints

#### Testnet

```
https://testnet-rpc.sign.global/api
```

#### Mainnet

```
https://mainnet-rpc.sign.global/api
```

### Hello World

```typescript
GET / index;
```

Status endpoint to verify the attestation backend is functional.

Parameters:

None

Response:

```json
{
  "success": true,
  "statusCode": 200,
  "data": "Welcome to Sign Protocol Service!",
  "message": "ok"
}
```

### Super Search

```typescript
GET / scan / search;
```

Search for relevant schemas, attestations, and addresses by providing a keyword and filter.

Query Parameters:

| Key       | Value       | Type                                     |
| --------- | ----------- | ---------------------------------------- |
| filter\*  | attestation | `"schema"`, `"attestation"`, `"address"` |
| keyword\* | 0x1         | string                                   |

\* Optional parameter.

Response:

```json
{
    "success": true,
    "statusCode": 200,
    "data": {
        "queryResult": [
            {
                "type": "attestation",
                "rows": [
                    {
                        "id": "onchain_evm_80001_0x1",
                        "chainType": "evm",
                        "chainId": "80001",
                        "attestationId": "0x1",
                        "attester": "0x9854E76134e6D729A633CED51042fF653f04f4C5",
                        "recipients": []
                    },
                    ...
                ],
                "total": 2
            }
        ]
    },
    "message": "ok"
}
```

### Get Address Statistics

```typescript
GET / scan / addresses / { address } / statistics;
```

Get attestation and schema statistics for an address.

Query Parameters:

| Key     | Value                                      | Type   |
| ------- | ------------------------------------------ | ------ |
| address | 0x059e6B8008d34aC26581fD3ED8378AA93c7941EE | string |

\* Optional parameter.

Response:

```json
{
  "success": true,
  "statusCode": 200,
  "data": {
    "schemaCreated": 6,
    "totalAttestations": 14,
    "attestationCreated": 13,
    "attestationReceived": 3
  },
  "message": "ok"
}
```
