# API Scan from CloudDefense UI

{% embed url="<https://youtu.be/AMYMaCTUzdc>" %}

### Step 1: Access to API application

Login to your CloudDefense Instance and click on “Scan” then “Other”. After this select “API”\
\ <br>

<figure><img src="https://lh3.googleusercontent.com/9fmHE141reijUEqChiaPfVqYZO7ontCePjP2jnNsXmV4KWIvhxeFmxtqOaV3sTyR45gdTb3-FiNXxoY_kpRkc6ltym0ixkXFyt4Lp-eqGXNvU2Qz0RSCp4rrbQG0PZIklfSHwhj9Kw6LDCFmzo4XiL16PssFy4-TojCyTIDxhyU06zrS5J1t2ieRyw" alt=""><figcaption><p><br></p></figcaption></figure>

<figure><img src="https://lh6.googleusercontent.com/GQ25WtEtuQdHV6EziO-FZvq2_MqWkXh-iIWv6I3AS55FuBIRGIAMOP15bihJGY4ztovxjHYxLM_a4J4KYSvhx402EsqZVYUZRM10IxlA54Ks7_RIxfGWA9zD6ibLX4JpnuSVNwDirb3Sdv-WQs2v07FpKS0OyQ2VGzRWR09gwMkchAeaqsRSvFlhWw" alt=""><figcaption></figcaption></figure>

### Step 2: Provide Swagger Details

<figure><img src="https://lh4.googleusercontent.com/6FkniAdC9N807-RqxhRKQJaUdpkS7y9r63gYXA9qvd9njDawbvLsW4J2Kf6yywNwe7O3gPzmMwYbszEq1lxxjSPYen6VePGm02gafr16DaFUy1qIfh_7llW1MZtg34sotSufaZIUJBm87skXUEGVJhnA-Fhw1tD8G_HafQnmUVqHy5ajjJXiHBylLg" alt=""><figcaption></figcaption></figure>

We’ll use `https://petstore.swagger.io/v2/swagger.json` for testing here (Remember we need json as output not any html website, there is difference between swagger viewer and swagger json)

In App URL you need to provide (Base URL) example - `https://petstore.swagger.io/` In JSON Path provide full URL of JSON - `https://petstore.swagger.io/v2/swagger.json`

### Step 3: Scan your API Key

Then click on “Run Scan” and your scan should start. API Scan from CloudDefense CLI guidelines are given below:

**a)** Install cdefense CLI in your Device using these steps - `https://github.com/CloudDefenseAI/cd#installation`&#x20;

**b)** Now run below command to run DAST Scan from CLI

`cdefense api --api-key=<CLOUDDEFENSE_API_KEY> --url=https://petstore.swagger.io/ --openapi-jsonurl=https://petstore.swagger.io/v2/swagger.json --project-name=example-api-scan --verbose`\
\
\
\
\
\ <br>
