> For the complete documentation index, see [llms.txt](https://docs.sitebot.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sitebot.com/api/antivirus.md).

# Antivirus

A file to be scanned can be uploaded in the API call or referenced by URL.\
\
This API is billed based on the amount of data scanned.  You may want to lookup the md5 prior to running a scan to optimize costs.

## Perform an antivirus scan on the file located at the url provided.

<mark style="color:blue;">`GET`</mark> `https://api.sitebot.com/api/v1/av/scan-url`

#### Query Parameters

| Name                                  | Type | Description                       |
| ------------------------------------- | ---- | --------------------------------- |
| url<mark style="color:red;">\*</mark> | URL  | The URL of a file to scan.        |
| callback                              | URL  | Send the scan result to this URL. |

#### Headers

| Name                                    | Type   | Description   |
| --------------------------------------- | ------ | ------------- |
| x-key<mark style="color:red;">\*</mark> | String | Your API Key. |

{% tabs %}
{% tab title="200: OK File was successfully downloaded from the URL and scan was initiated." %}

```
{
   size: 11,
   md5: "5eb63bbbe01eeed093cb22bb8f5acdc3"
}
```

{% endtab %}

{% tab title="400: Bad Request See "message" in json response." %}

{% endtab %}
{% endtabs %}

## Perform an antivirus scan on the file uploaded.

<mark style="color:green;">`POST`</mark> `https://api-upload.sitebot.com/api/v1/av/scan-upload`

**Note**: There is a unique hostname for this API endpoint.

#### Headers

| Name                                    | Type   | Description                       |
| --------------------------------------- | ------ | --------------------------------- |
| x-callback                              | URL    | Send the scan result to this URL. |
| x-key<mark style="color:red;">\*</mark> | String | Your API Key.                     |

{% tabs %}
{% tab title="200: OK File was successfully uploaded the scan was initiated." %}

```
{
   size: 11,
   md5: "5eb63bbbe01eeed093cb22bb8f5acdc3"
}
```

{% endtab %}

{% tab title="400: Bad Request See "message" in json response." %}

{% endtab %}
{% endtabs %}

## Lookup the antivirus summary of a md5 checksum.

<mark style="color:blue;">`GET`</mark> `https://api.sitebot.com/api/v1/av/lookup`

A successful lookup will have one of the following status values: "working", "pass", "fail", "error".

#### Query Parameters

| Name                                  | Type   | Description                 |
| ------------------------------------- | ------ | --------------------------- |
| md5<mark style="color:red;">\*</mark> | String | The md5 checksum of a file. |

#### Headers

| Name                                    | Type   | Description   |
| --------------------------------------- | ------ | ------------- |
| x-key<mark style="color:red;">\*</mark> | String | Your API Key. |

{% tabs %}
{% tab title="200: OK Lookup result in json response." %}

```
{
        "md5":"5eb63bbbe01eeed093cb22bb8f5acdc3",
        "size":11,
        "status":3,
        "status_display":"Fail",
        "fail":1,
        "pass":0
}
```

{% endtab %}

{% tab title="400: Bad Request See "message" in json response." %}

{% endtab %}
{% endtabs %}

## Callback URL

An optional callback URL can be provided in the scan-url and scan-upload methods.  When the scan completes the json body of the lookup method will be posted to the callback URL.

## Example URL

```
curl --header "x-key: [YOUR-API-KEY]" \
"https://api.sitebot.com/api/v1/av/scan-url.json?url=[URL-TO-SCAN]&callback=[CALLBACK-URL]"
```

## Example Upload

```
curl --header "x-key: [YOUR-API-KEY]" \
--header "content-type: application/octet-stream" \
--header "x-callback: https://www.mywebsite/rpc/sitebot-callback" \
--data-binary "@/path/to/file" \
"https://api-upload.sitebot.com/api/v1/av/scan-upload"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sitebot.com/api/antivirus.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
