# Currency API

A currency converter API is like a real-time financial translator, allowing you to convert currencies instantly and integrate this feature into websites, apps, and other services. It's the key for applications that need accurate and up-to-date exchange rates

### Base URL

The base URL for the Currency API is:

```
https://santechapi.vercel.app
```

### Authentication

<pre><code>headers : {
"token" : {YOUR API KEY}
<strong>}
</strong></code></pre>

**Endpoint:** `/currency/{from}/{to}/{amount}`&#x20;

#### ***HTTP Method:** GET*

### Parameters:

* {from}: The base currency code.
* {to}: The target currency code.
* {amount}: The amount to be converted.

**Example Request:**

```
GET /currency/usd/inr/100
```

**Example Response:**

**`200`**

```
{
	"amount": 100,
	"base": "USD",
	"date": "2023-12-08",
	"rates": {
		"INR": 8341
	}
}
```

The response includes the converted amount, base currency, conversion date, and the converted amount in the target currency.

### Error Handling

In case of an error, the API will respond with an appropriate HTTP status code and an error message in the response body.

**Example Error Response:**

**`402`**

```
 { 
    "message": "All params are Required in order to fetch the currency conversion result"
 }
```

&#x20;note that the currency codes should follow the ISO 4217 standard.&#x20;

If you have any further questions or need additional assistance, feel free to ask.


---

# Agent Instructions: 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:

```
GET https://santech.gitbook.io/docs/currency-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
