> ## Documentation Index
> Fetch the complete documentation index at: https://chainpatrol.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# asset.check

> Check the real-time threat status of a single URL, page, social profile, or blockchain address with the ChainPatrol JavaScript SDK's asset.check API method.

The `asset.check` method allows you to check the current threat status of a single asset. This method is ideal for real-time protection and individual asset verification.

## API Reference

### Method Signature

```typescript theme={null}
client.asset.check(request: AssetCheckInput): Promise<AssetCheckOutput>
```

### Parameters

**request** `AssetCheckInput` *required*

The asset check request object containing the asset type and content.

**AssetCheckInput Properties**

**type** `enum\<string\>` *required*

The type of asset you are checking.

Supported types: `URL`, `PAGE`, `ADDRESS`.

**content** `string` *required*

The actual asset content you are checking.

* For `URL` or `PAGE` assets: The URL of the asset
* For `ADDRESS` assets: The wallet or contract address

### Returns

**status** `enum\<string\>` *required*

The threat status of the asset.

Possible values: `UNKNOWN`, `ALLOWED`, `BLOCKED`.

**reason** `string`

The reason why the asset was allowed or blocked (if applicable). ChainPatrol
aggregates data from multiple sources: - `eth-phishing-detect` - Asset is on
MetaMask's blocklist - `reported` - Asset was reported by users and added to
ChainPatrol's blocklist

### Supported Asset Types

> [card] URL
>
> Web URLs and domains
>
> `https://example.com`

&#x20;

> [card] PAGE
>
> Specific web pages `https://site.com/login`

> [card] ADDRESS
>
> Crypto addresses
>
> `0x1234...abcd`

### Status Types

> [accordion] BLOCKED
>
> The asset has been identified as malicious or suspicious and should be blocked.

&#x20;

> [accordion] ALLOWED
>
> The asset has been verified as safe and can be trusted.

> [accordion] UNKNOWN
>
> The asset hasn't been classified yet. Use your own discretion or additional verification.

## Getting Started

### Quick Start

```typescript Basic Check theme={null}
import { ChainPatrolClient } from "@chainpatrol/sdk";

const client = new ChainPatrolClient({
apiKey: "cp_live_your_api_key_here",
});

const result = await client.asset.check({
type: "URL",
content: "https://suspicious-site.com",
});

console.log(result);

```

```typescript Address Check theme={null}
const result = await client.asset.check({
  type: "ADDRESS",
  content: "0x1234567890abcdef1234567890abcdef12345678",
});

if (result.status === "BLOCKED") {
  console.warn(`🚨 Blocked address: ${result.reason}`);
} else {
  console.log("✅ Address appears safe");
}
```

```json Example Response theme={null}
{
  "status": "BLOCKED",
  "reason": "eth-phishing-detect"
}
```

### Basic Usage Patterns

```typescript theme={null}
// Simple safety check
async function isSafe(url: string): Promise<boolean> {
  const result = await client.asset.check({
    type: "URL",
    content: url,
  });

  return result.status !== "BLOCKED";
}

// Detailed threat analysis
async function analyzeThreat(asset: string, type: "URL" | "ADDRESS") {
  const result = await client.asset.check({ type, content: asset });

  return {
    isSafe: result.status !== "BLOCKED",
    status: result.status,
    reason: result.reason,
    recommendation:
      result.status === "BLOCKED" ? "Block access" : "Allow access",
  };
}
```

## Implementation Guide

### Real-time Protection

```typescript theme={null}
async function checkAssetSafety(url: string): Promise<boolean> {
  try {
    const result = await client.asset.check({
      type: "URL",
      content: url,
    });

    switch (result.status) {
      case "BLOCKED":
        console.warn(`🚨 Blocked: ${url} (${result.reason})`);
        return false;
      case "ALLOWED":
        console.log(`✅ Allowed: ${url}`);
        return true;
      case "UNKNOWN":
        console.log(`❓ Unknown: ${url} - proceed with caution`);
        return true; // Or implement your own logic
      default:
        return true;
    }
  } catch (error) {
    console.error("Asset check failed:", error);
    return false; // Fail safe
  }
}
```

### Browser Extension Integration

```typescript theme={null}
// Content script for browser extension
class URLMonitor {
  private client: ChainPatrolClient;

  constructor(apiKey: string) {
    this.client = new ChainPatrolClient({ apiKey });
  }

  async checkCurrentPage(): Promise<void> {
    const currentUrl = window.location.href;

    const result = await this.client.asset.check({
      type: "URL",
      content: currentUrl,
    });

    if (result.status === "BLOCKED") {
      this.showWarning(result.reason);
    }
  }

  private showWarning(reason: string): void {
    // Display warning to user
    console.warn(`⚠️ This site may be dangerous: ${reason}`);
  }
}
```

### Batch Checking with Rate Limiting

```typescript theme={null}
async function checkMultipleAssets(assets: string[]) {
  const results = [];

  for (const asset of assets) {
    try {
      const result = await client.asset.check({
        type: "URL",
        content: asset,
      });

      results.push({ asset, ...result });

      // Rate limiting - wait between requests
      await new Promise((resolve) => setTimeout(resolve, 100));
    } catch (error) {
      console.error(`Failed to check ${asset}:`, error);
    }
  }

  return results;
}
```

## Technical Details

### Error Handling

```typescript theme={null}
import { ChainPatrolClientError } from "@chainpatrol/sdk";

try {
  const result = await client.asset.check({
    type: "URL",
    content: "example.com",
  });
} catch (error) {
  if (error instanceof ChainPatrolClientError) {
    console.error("API Error:", error.message);
  } else {
    console.error("Unexpected error:", error);
  }
}
```

### Rate Limits & Performance

> [!NOTE]
>
> **Rate Limits** - Individual requests: Up to 10 requests per second -
> Recommended for real-time checking - For bulk operations, use `asset.list`
> instead

> [!WARNING]
>
> **Performance Considerations** - Cache results when possible to reduce API
> calls - Implement exponential backoff for failed requests - Consider using
> `asset.list` for bulk checking scenarios

## Related Resources

### Related Methods

> [card] [asset.submit](../asset-submit)
>
> Submit assets for threat classification

> [card] [asset.list](../asset-list)
>
> Retrieve lists of assets with filtering

### Additional Documentation

* [Asset Types Guide](https://chainpatrol.com/docs/glossary/asset-types/page.md)
* [Error Handling Best Practices](https://chainpatrol.com/docs/general/api-key.md)
* [Rate Limiting Guidelines](https://chainpatrol.com/docs/external-api/overview.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.