# Get started with the API

### Use the API

#### Before you get started with the API you have to create your Authentication Token or API Key first in NMKR Studio. Depending on the network you are going to use, you need to [**create an API Key in either the testnet account, or the mainnet account**](https://docs.nmkr.io/nmkr-studio/account/api-keys)**.**

{% hint style="warning" %}
The majority of requests will use *some* (or **all** of) the following elements:

* **Base URI,** Comprised of:
  * **Web Address**
  * **API Version**
  * **The Method Name**
  * *Project UID*
  * *NFT UID*
  * *NFT Count*
  * *JSON Payload*
  * *Requestor IP address*
  * *Other Specific Method Data*
* **API Key as a BEARER TOKEN in the Request Header**\
  \
  You can run API calls from your computer using most popular languages but if you plan to allow users on your website to invoke them, you must ensure you set up your website using server frontend/backend principles. The reason for this is that most browsers will simply block any attempt to make an API call from the front-end UI (CORS Policy Error).
  {% endhint %}

{% hint style="info" %}
Note - the Project and NFT UID's are now both random strings that cannot be predicted, this extra security feature means that attackers cannot 'guess' the ID, making certain attacks more difficult even if the API Key is compromised.
{% endhint %}

{% hint style="danger" %}
Note - NEVER EXPOSE YOUR API KEY, IF YOU DO, DELETE IT AND MAKE A NEW ONE IMMEDIATELY.
{% endhint %}

### API URL Testnet (preprod) and Mainnet

#### Testnet (preprod) API

```
https://studio-api.preprod.nmkr.io/v2/
```

#### Mainnet API

```
https://studio-api.nmkr.io/v2/
```

#### Example CURL

```
curl -X 'GET' \
  'https://studio-api.nmkr.io/v2/endpoint/aaaaaaa-bbbb-cccc-dddd-eeeeeeeeee' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxx'
```

### Learn to use the API

Before you implement the API Endpoints into your DApp or website, you may want to test it out in the [API Swagger](https://docs.nmkr.io/nmkr-studio-api/api-swagger). The API Swagger is available for the [Mainnet](https://docs.nmkr.io/nmkr-studio-api/api-swagger) as well as for the [Testnet](https://docs.nmkr.io/nmkr-studio/testnet/testnet-api-swagger).<br>

{% embed url="<https://studio-api.nmkr.io/swagger/index.html>" %}

Another very useful tool to test API is Postman. Postman is an API platform for developers to design, build, test and iterate their APIs.

{% embed url="<https://www.postman.com/>" %}

### API templates and examples

We also provide[ API Examples and Templates](https://docs.nmkr.io/nmkr-studio-api/api-examples) for the most common workarounds and features of the NMKR Studio API.
