# Introduction

Discover the full capabilities of our APIs through detailed endpoint descriptions, request parameters, response formats, and authentication methods. With easy-to-follow examples and code snippets.

ZioMark's HUB Documentation is your comprehensive guide to understanding and harnessing the power of ZioMark's HUB, the centralized platform for managing and developing ZioMark's Multi Purpose API services. Whether you're a developer integrating ZioMark's Multi Purpose API into your applications, a project manager overseeing API-related tasks, or an administrator maintaining API operations, this documentation provides you with everything you need to know.

### What is ZioMark's HUB API?

ZioMark's HUB serves as the heart of ZioMark's Multi Purpose API ecosystem, offering a robust set of tools and features for efficiently managing API functionalities. From generating invoices and managing clients to monitoring API usage and configuring settings, ZioMark's HUB provides a unified platform for streamlined API management and development.

#### Key Features:

* **Invoice Generation:** Easily generate invoices for transactions using customizable templates and dynamic data integration.
* **Client Management:** Seamlessly manage client information, track interactions, and maintain client relationships.
* **API Integration:** Integrate ZioMark's Multi Purpose API seamlessly into your applications with comprehensive documentation and code examples.
* **Usage Monitoring:** Monitor API usage, analyze performance metrics, and optimize resource allocation for enhanced efficiency.
* **Configuration Settings:** Configure API settings, manage access controls, and customize functionality to suit your specific requirements.

#### Getting Started

Whether you're a seasoned developer or new to ZioMark's ecosystem, our getting started guide provides step-by-step instructions for setting up your account, accessing API resources, and leveraging ZioMark's HUB to its fullest potential.

#### API Reference:

Explore our detailed API reference documentation for comprehensive insights into API endpoints, request parameters, response formats, and authentication methods. With clear explanations and code snippets, you'll be able to quickly integrate ZioMark's Multi Purpose API into your applications.

#### Community Support

Join our vibrant community of developers, project managers, and API enthusiasts to share knowledge, exchange ideas, and collaborate on projects. Get help, offer advice, and stay updated on the latest developments in the ZioMark's ecosystem.

#### Start Exploring

Ready to unlock the full potential of ZioMark's HUB? Dive into our documentation today and discover how you can streamline API management, enhance developer productivity, and drive innovation with ZioMark's powerful API platform.


# Authentication

### Base URL

The base URL for all API requests is: <https://zmh-ziomark-hub-3308111c.koyeb.app/>

To access the API, you will need an API key. Please request one by opening a ticket on our Discord server at: <https://ds.ziomark.xyz/>

### • Authentication

To authenticate for API requests, you need to include an API key in the request headers.

Add the following header to your request:

```
            
    Authorization: Bearer YOUR_API_KEY       
        
```

Replace `YOUR_API_KEY` with your valid API key.

If the API key is missing or invalid, you will receive an error response.

{% hint style="info" %}
Join our discord to get your API KEY <https://ds.ziomark.xyz/>
{% endhint %}


# GET Endpoints

## ZioMark's HUB Multipurpose API GET Endpoints

Welcome to ZioMark's HUB Multipurpose API! Our API offers a range of functionalities accessible through simple `GET` requests. Whether you need to retrieve data, perform calculations, or generate cryptographic keys, our API has you covered.

### Overview

Our API provides `GET` endpoints for various purposes, including:

* Retrieving local time for different countries.
* Calculating discounted prices based on original prices and discount percentages.
* Generating cryptographic keys in different styles.
* Converting currencies with real-time exchange rates.
* Translating text between different languages.
* Fetching weather information for specified cities.
* Converting HTML content to PDF documents.
* Generating dynamic images with text overlays.
* Formatting date and time according to different standards.

These endpoints are designed to be versatile and easy to integrate into your applications. Whether you're building a web application, mobile app, or any other software solution, our API can provide the data and functionality you need.

For detailed documentation on each endpoint, including query parameters and response formats, please refer to the corresponding sections below.


# Dec to Hex

Converts a decimal number to hexadecimal.

### /dec-to-hex

Query Parameters:

* `dec` - The decimal number to convert.

Example Request:

```
/dec-to-hex?dec=255
```

Example Response:

```
{
    "decimal": 255,
    "hexadecimal": "ff"
}
```


# Hex to Dec

Converts a hexadecimal number to decimal.

### /hex-to-dec

Query Parameters:

* `hex` - The hexadecimal number to convert.

Example Request:

```
/hex-to-dec?hex=ff
```

Example Response:

```
{
    "hexadecimal": "ff",
    "decimal": 255
}
```


# Timetamp to Date

Converts a UNIX or ISO8601 timestamp to a formatted date string.

### /timestamp-to-date

Query Parameters:

* `timestamp` - The [UNIX](https://it.wikipedia.org/wiki/Unix) or [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp to convert

Example Request:

```
/timestamp-to-date?timestamp=1618154400
/timestamp-to-date?timestamp=2024-04-17T18:49:36Z
```

Example Response:

```
{
    "timestamp": 1618154400,
    "formattedDate": "11/04/2021 00:00"
}
```


# CFX

Retrieves information about a FiveM or RedM server.

## /cfx/:serverId

### Query Parameters:

* `serverId` - The ID of the FiveM server.

### Example Request:

```
/cfx/server123
```

### Example Response:

```
{
    "Data": {
        "hostname": "exampleServer",
        "resources": "resource1, resource2, resource3",
        ...
    }
}
```


# Date

Returns today's date and time in various formats like dd/mm/YYYY, ISO8601 and UNIX

## /date

Returns today's date and time in various formats like dd/mm/YYYY, ISO8601 and UNIX

### Query parameters

`format` EU *or* US

{% hint style="info" %}
Based on the selected format you will get the value **"date"** as follows:

EU: **dd/mm/YYYY**\
US: **YYYY-mm-dd**
{% endhint %}

### Example Response

```
{
    "date": "17/04/2024",
    "time": "21:22:38",
    "iso8601": "2024-04-17T19:22:38.249Z",
    "unix": 1713381758
}
```


# Date & Time Formatter

## /format-date-time

This endpoint formats the provided date and times from the query parameters into the specified formats and returns them in the response.

### Query Parameters

* `data`: (string) Date in the format "DD/MM/YYYY".
* `ora`: (string) Time in the format "HH:MM" (24-hour format).
* `ora2`: (string) Another time in the format "HH:MM" (24-hour format).

### Response

The response will contain a JSON object with the formatted date and times.

* `formattedDate`: (string) Date in the format "YYYY-MM-DD".
* `formattedTime1`: (string) Time 1 in the format "HH:MM".
* `formattedTime2`: (string) Time 2 in the format "HH:MM".

### Example

```json
{
    "formattedDate": "2024-04-22",
    "formattedTime1": "09:30",
    "formattedTime2": "17:00"
}
```


# Text over Image

This endpoint allows you to generate an image with customizable text and subtitle on a specified background. The generated image is then uploaded to Imgur, and the URL is returned.

## /text-over-image

### Query Parameters

* `background`: (string) URL of the background image.
* `text`: (string) Text to overlay on the background image.
* `color`: (string) Color of the text in hexadecimal format (e.g., "#ffffff").
* `fontStyle`: (string, optional) Style of the main text font (e.g., "Arial", "Times New Roman").
* `fontSize`: (string, optional) Size of the main text font in pixels (e.g., "30px").
* `alignment`: (string) Alignment of the main text and subtitle. Possible values are:
  * "center"
  * "topleft"
  * "topcenter"
  * "topright"
  * "bottomleft"
  * "bottomcenter"
  * "bottomright"
* `subtitle`: (string, optional) Subtitle text to overlay on the background image.
* `subtitleColor`: (string, optional) Color of the subtitle text in hexadecimal format.
* `subtitleFontStyle`: (string, optional) Style of the subtitle font.
* `subtitleFontSize`: (string, optional) Size of the subtitle font in pixels.

```javascript
Arial
Helvetica
Georgia
Times New Roman
Verdana
Comic Sans MS
Tahoma
Palatino
Courier New
```

### Response

```json
{
    "imageUrl": "https://imgur.com/your_generated_image_url"
}
```

### Example

```
GET /generate-image?background=<background_url>&text=Hello&color=black&fontStyle=Arial&fontSize=40&alignment=center&subtitle=World&subtitleColor=red&subtitleFontStyle=Arial&subtitleFontSize=30
```

#### Notes

* If any error occurs during image generation or upload, a 500 error response will be returned with an error message.

***


# Image over Image

This endpoint allows you to overlay one image on top of another image. You can specify the background image, overlay image, alignment, and size of the overlay.

## /image-over-image

### Query Parameters

* `background`: URL of the background image.
* `overlay`: URL of the overlay image.
* `alignment`: Alignment of the overlay image. Possible values: `topleft`, `topcenter`, `topright`, `middleleft`, `center`, `middleright`, `bottomleft`, `bottomcenter`, `bottomright`. Default is `center`.
* `size`: Size of the overlay image as a percentage of the background image width. Default is `100`.

### Example

```http
GET /image-over-image?background=https://example.com/background.jpg&overlay=https://example.com/overlay.png&alignment=topright&size=50
```

### Response

```json
{
  "imageUrl": "https://i.imgur.com/abc123.jpg"
}
```

### Errors

* `500 Internal Server Error`: Failed to generate or upload image.


# Weather

## /weather

This endpoint retrieves weather information for a specified city. It accepts a GET request with query parameters including the `city`, `format`, and `lang`. If any of these parameters are missing, it returns a custom HTML page indicating missing parameters. If the city is not found, it throws an error. If the weather data is successfully fetched, it returns the temperature, weather description, time of observation, and the city name. If the weather data retrieval fails or an error occurs, it returns a corresponding error message with a status code of 500.

### Query Parameters

| Parameter | Type   | Description                                                             |
| --------- | ------ | ----------------------------------------------------------------------- |
| city      | string | The name of the city for which weather data is requested.               |
| format    | string | The format of the temperature (e.g., 'metric', 'imperial', 'standard'). |
| lang      | string | The language code for the response (e.g., 'en', 'fr', 'es').            |

### Example Usage

```
GET /weather?city=London&format=metric&lang=en
```

### Response

```
{
  "temperature": 20,
  "description": "Cloudy",
  "time": "10:30:00 AM",
  "city": "London"
}
```


# Translate

This API endpoint allows you to translate text from one language to another using the MyMemory Translation API.

## /translate

This endpoint translates text from one language to another based on the provided parameters. It accepts a GET request with query parameters including the `text`, `fromLang`, and `toLang`. If any of these parameters are missing, it returns a custom HTML page indicating missing parameters. If the translation is successful, it returns the original text along with its translation. If the translation fails or an error occurs, it returns a corresponding error message with a status code of 500.

### Query Parameters

| Parameter | Type   | Description                                          |
| --------- | ------ | ---------------------------------------------------- |
| text      | string | The text to be translated.                           |
| fromLang  | string | The language code of the text to be translated from. |
| toLang    | string | The language code of the text to be translated to.   |

### Example Usage

Translate "Hello, how are you?" from English to Spanish:

`GET /translate?text=Hello how are you&fromLang=en&toLang=es`

### Example Response

```
{
  "originalText": "Hello, how are you?",
  "translatedText": "¡Hola, ¿cómo estás?"
}
```

### Languages Supported

Go find all the language codes and their corresponding ISO 639-1 or RFC3066 codes online or in language code standards documentation.


# Convert Currency

This endpoint allows you to convert currency between different units using real-time exchange rates. Optionally, you can include the currency symbol in the response along with the converted value

## /convert-currency

This endpoint performs currency conversion from one currency to another based on the provided parameters. It accepts a GET request with query parameters including the `value`, `fromCurrency`, and `toCurrency`. If any of these parameters are missing, it returns a custom HTML page indicating missing parameters. If the conversion is successful, it returns the converted value. If the `format` parameter is set to 'true', the converted value will be formatted with the currency symbol. If the conversion fails or an error occurs, it returns a corresponding error message with a status code of 400 or 500.

### Query Parameters

| Parameter    | Type   | Description                                                                                  |
| ------------ | ------ | -------------------------------------------------------------------------------------------- |
| value        | number | The value to be converted.                                                                   |
| fromCurrency | string | The currency code of the value to be converted from.                                         |
| toCurrency   | string | The currency code of the value to be converted to.                                           |
| format       | string | (Optional) If set to 'true', the converted value will be formatted with the currency symbol. |

### Response

```json
{
  "convertedValue": "string | number"
}
```

### Example

```
GET /convert-currency?value=100&fromCurrency=USD&toCurrency=EUR&format=true
```

### Supported Currency Codes and Symbols

* **USD**: United States Dollar ($)
* **EUR**: Euro (€)
* **GBP**: British Pound Sterling (£)
* **JPY**: Japanese Yen (¥)
* **CNY**: Chinese Yuan (¥)
* **AUD**: Australian Dollar (A$)
* **CAD**: Canadian Dollar (C$)
* **CHF**: Swiss Franc (CHF)
* **SEK**: Swedish Krona (kr)
* **NZD**: New Zealand Dollar (NZ$)
* **KRW**: South Korean Won (₩)
* **SGD**: Singapore Dollar (S$)
* **NOK**: Norwegian Krone (kr)
* **MXN**: Mexican Peso (Mex$)
* **INR**: Indian Rupee (₹)
* **RUB**: Russian Ruble (₽)
* **ZAR**: South African Rand (R)
* **HKD**: Hong Kong Dollar (HK$)
* **TRY**: Turkish Lira (₺)
* **BRL**: Brazilian Real (R$)
* **TWD**: New Taiwan Dollar (NT$)
* **DKK**: Danish Krone (kr)
* **PLN**: Polish Złoty (zł)
* **THB**: Thai Baht (฿)
* **CZK**: Czech Crown (Kč)

### Notes

* If the conversion is successful, the converted value will be returned as a JSON response. Optionally formatted with the currency symbol if requested.
* If the provided currency codes are invalid or not supported, a 400 error response with an error message will be returned.
* If any error occurs during currency conversion, a 500 error response with an error message will be returned.
* If the symbol is not available for the wanted currency you will receive a message like:\
  `This currency doesn't have a symbol`


# Geolocation

## /geolocation

This endpoint accepts a GET request with a query parameter `address`. It retrieves geolocation data for the provided address and returns the address along with its corresponding latitude and longitude. If the address parameter is missing, it returns a 400 error with a corresponding message. If no geolocation data is found for the provided address, it returns a 404 error with a corresponding message. If there is an error during the retrieval process, it returns a 500 error with a corresponding message.

### Query Parameters

| Parameter | Type   | Description                                          |
| --------- | ------ | ---------------------------------------------------- |
| address   | string | The address for which geolocation data is requested. |

## **Responses**

* `200 OK`: Geolocation data successfully retrieved.

  ```json
  {
    "address": "1600 Amphitheatre Parkway, Mountain View, CA, USA",
    "latitude": 37.423021,
    "longitude": -122.083739
  }
  ```
* `400 Bad Request`: Missing or invalid query parameters.

  ```json
  {
    "error": "Address parameter is missing"
  }
  ```
* `404 Not Found`: Geolocation data not found for the provided address.

  ```json
  {
    "error": "Geolocation data not found for the provided address"
  }
  ```
* `500 Internal Server Error`: An unexpected error occurred while processing the request.

  ```json
  {
    "error": "Internal server error"
  }
  ```

**Example**

```
GET /geolocation?address=1600%20Amphitheatre%20Parkway,%20Mountain%20View,%20CA
```


# QR Code Generator

## /generate-qrcode

This endpoint accepts a GET request with query parameters including the `url`, `color`, and `pattern`. It generates a QR code based on the provided URL or text, with the specified color and pattern options if provided. If the `color` parameter is provided, it returns the QR code as a PNG image with the specified color. Otherwise, it returns the QR code as a base64-encoded string. If there is an error during the generation process, it returns a 500 error with a corresponding message.

### Query Parameters

| Parameter | Type   | Description                                                                |
| --------- | ------ | -------------------------------------------------------------------------- |
| url       | string | The URL or text to encode into the QR code.                                |
| color     | string | The color of the dark modules in the QR code (optional, default is black). |
| pattern   | number | The QR code pattern (optional).                                            |

### Response

* If `color` parameter is provided, the endpoint returns a PNG image of the generated QR code with the specified color.
* If `color` parameter is not provided, the endpoint returns a base64-encoded string representation of the generated QR code.

### Example

#### Request

GET /generate-qrcode?url=<https://example.com\\&color=%235DE2E7\\&pattern=3>

#### Response

If successful, the response will be a PNG image of the generated QR code with the specified color and pattern.

<figure><img src="/files/K2klsGPECrqlIoBhFUnm" alt=""><figcaption></figcaption></figure>

### Error Handling

* If an error occurs during QR code generation, the endpoint will return a 500 Internal Server Error response with an error message.

{% hint style="info" %}
Please note that the `url` parameter is required, while `color` and `pattern` are optional. If `color` is not specified, default color values will be used. The `pattern` parameter allows you to choose the mask pattern used in the QR code generation process.
{% endhint %}


# Image Format Converter

## /es5-es6

This endpoint accepts a GET request with query parameters including the `imageUrl`, `format`, and optionally `quality`. It fetches the image from the provided URL, converts it to the specified format with the given quality, and sends the converted image as the response. If any required parameters are missing or invalid, or there is an error during the conversion process, it returns a 400 or 500 error with a corresponding message.

### Query Parameters

* `imageUrl`: The URL of the image to be converted. (Required)
* `format`: The target format to which the image should be converted (`jpeg`, `jpg`, `png`, or `webp`). (Required)
* `quality`: The quality level of the converted image. It should be an integer value between 1 and 100. The default quality is 80 if not specified.

### Example

```http
GET /es5-es6?imageUrl=http://example.com/image.jpg&format=webp&quality=80
```

### Response

* If the conversion is successful, the API returns the converted image with the appropriate content type set.
* If there are any errors during the conversion process or fetching the image, the API returns an error response with status code `500` and a JSON object containing the error message.

### Notes

* Supported input formats: JPEG, PNG, and WebP.
* Supported output formats: JPEG, PNG, and WebP.
* The quality parameter is only applicable for formats like JPEG and WebP. It affects the compression level and file size of the converted image.


# Key Generator

## /keygen

This endpoint generates random keys based on the specified style provided in the query parameters. Supported styles include 'codeigniter encryption keys', '256-bit wep keys', '160-bit wpa key', '504-bit wpa key', '64-bit wep keys', '128-bit wep keys', '152-bit wep keys', 'serial', 'serial2', and 'serial3'. If the style is not provided or invalid, it returns a 400 error with a corresponding message.

### Query Parameters

| Parameter | Type   | Description                            |
| --------- | ------ | -------------------------------------- |
| `style`   | String | The format type for the generated key. |

### Responses

**Content-Type:** application/json

**Body:**

```json
{
    "key": "ABCD-EFGH-IJKL-MNOP"
}
```

### Serial Style

Formats the raw key to resemble a serial key based on the specified format type. Supports three format types:

* `'serial'`: Formats to `XXXX-XXXX-XXXX` where `X` represents a character.
* `'serial2'`: Formats to `XXXXX-XXXXX-XXXXX`.
* `'serial3'`: Formats to `XXXXX-XXX-XXXXX-XXX`. If no format type matches, it returns the raw key without any formatting.

### Other Styles

```javascript
256-bit wep keys
```

```javascript
160-bit wpa key
```

```javascript
504-bit wpa key
```

```javascript
64-bit wep keys
```

```javascript
128-bit wep keys
```

```javascript
152-bit wep keys
```

#### Note

* This API is intended for generating random keys for various purposes such as software licenses, access tokens, etc.


# Bored

## /bored

This endpoint retrieves a random activity from the specified category. If no valid category is provided, it returns a 400 error with a message indicating the valid options.

### Query Parameters

| Parameter | Type   | Description                                                                                  |
| --------- | ------ | -------------------------------------------------------------------------------------------- |
| category  | string | The category of activity. Options: Development, Artistic, Relax, Outdoor, Learning, Reading. |

### Response

```json
{
  "activity": "string"
}
```


# BMI Calculator

## /calculate-bmi

This endpoint calculates the Body Mass Index (BMI) of an individual based on the provided weight, height, age, and unit system. It returns the calculated BMI along with the BMI category, which is determined based on age. If any of the parameters are missing or invalid, it returns a 400 error with a corresponding message.

### Query Parameters

| Parameter | Type   | Description                                                                    |
| --------- | ------ | ------------------------------------------------------------------------------ |
| weight    | number | Weight of the individual in kilograms or pounds (based on `unit`).             |
| height    | number | Height of the individual in centimeters or inches (based on `unit`).           |
| age       | number | Age of the individual in years.                                                |
| unit      | string | The unit system used for weight and height. Options: "metric" (default), "us". |

### Response

```json
{
    "age": "number",
    "bmi": "string",
    "bmiCategory": "string"
}
```


# VAT Calculator

## /vat

This endpoint calculates the VAT (Value Added Tax) amount and total price based on the provided price and VAT rate. It returns the original price, VAT rate, calculated VAT amount, and total price. If any of the parameters are missing, not numbers, or the VAT rate is negative, it returns a 400 error with a corresponding message.

### Query Parameters

| Parameter | Type   | Description                                            |
| --------- | ------ | ------------------------------------------------------ |
| price     | number | The price of the product or service.                   |
| vatRate   | number | The VAT rate in percentage to be applied to the price. |

### Response

```json
{
  "originalPrice": "number",
  "vatRate": "string",
  "vatAmount": "number",
  "totalPrice": "number"
}
```


# SEO Analyzer

## /seo

This endpoint analyzes the SEO (Search Engine Optimization) aspects of a webpage specified by the provided URL. It retrieves the title, meta description, canonical URL, charset, robots meta tag, theme color, and language information. If any of the required parameters are missing, it returns a 400 error with a corresponding message. If there is an error fetching or analyzing the URL, it returns a 500 error with a message.

### Query Parameters

| Parameter | Type   | Description                        |
| --------- | ------ | ---------------------------------- |
| url       | string | The URL of the webpage to analyze. |

### Response

```json
{
  "title": {
    "content": "string",
    "length": "number"
  },
  "metaDescription": {
    "content": "string",
    "length": "number"
  },
  "canonicalURL": "string",
  "charset": "string",
  "robots": "string",
  "themeColor": "string",
  "language": "string"
}
```


# Local Time

## /local-time

This endpoint retrieves the current local time of the specified country based on the provided ISO 3166-1 alpha-2 country code. It returns the country's time zone and the current local time in the format 'YYYY-MM-DD HH:mm:ss'. If the provided country code is invalid or the time zone data is not available, it returns a 404 error with a corresponding message.

### Query Parameters

| Parameter   | Type   | Description                          |
| ----------- | ------ | ------------------------------------ |
| countryCode | string | The ISO 3166-1 alpha-2 country code. |

### Response

```json
{
  "countryTimezone": "string",
  "localTime": "string"
}
```

### Supported Countries (always updated)

* IT: Europe/Rome
* DE: Europe/Berlin
* UK: Europe/London
* US\_NY: America/New\_York
* US\_CA: America/Chicago
* US\_MT: America/Denver
* US\_PAC: America/Los\_Angeles
* US\_AK: America/Anchorage
* US\_HI: Pacific/Honolulu
* CA\_ON: America/Toronto
* CA\_BC: America/Vancouver
* CA\_AB: America/Edmonton
* CA\_MB: America/Winnipeg
* CA\_NS: America/Halifax
* CA\_NL: America/St\_Johns
* AU\_NSW: Australia/Sydney
* AU\_WA: Australia/Perth
* AU\_SA: Australia/Adelaide
* AU\_QLD: Australia/Brisbane
* AU\_NT: Australia/Darwin
* AU\_TAS: Australia/Hobart
* IN: Asia/Kolkata
* JP: Asia/Tokyo
* BR\_SP: America/Sao\_Paulo
* BR\_AM: America/Manaus
* BR\_PE: America/Recife
* BR\_AC: America/Rio\_Branco
* ZA: Africa/Johannesburg
* FR: Europe/Paris
* ES: Europe/Madrid
* MX\_CTY: America/Mexico\_City
* MX\_CUN: America/Cancun
* MX\_MTY: America/Monterrey
* CN\_SH: Asia/Shanghai
* CN\_UR: Asia/Urumqi
* RU\_MS: Europe/Moscow
* RU\_YE: Asia/Yekaterinburg
* RU\_OM: Asia/Omsk
* RU\_KR: Asia/Krasnoyarsk
* RU\_IR: Asia/Irkutsk
* RU\_YA: Asia/Yakutsk
* RU\_VL: Asia/Vladivostok
* RU\_MA: Asia/Magadan
* KR: Asia/Seoul
* SG: Asia/Singapore
* NG: Africa/Lagos
* SA: Asia/Riyadh
* AE: Asia/Dubai
* AR: America/Argentina/Buenos\_Aires
* CL: America/Santiago
* CO: America/Bogota
* EG: Africa/Cairo
* ID: Asia/Jakarta
* IL: Asia/Jerusalem
* MY: Asia/Kuala\_Lumpur
* NZ: Pacific/Auckland
* PH: Asia/Manila
* PK: Asia/Karachi
* PL: Europe/Warsaw
* SE: Europe/Stockholm
* TH: Asia/Bangkok
* TR: Europe/Istanbul
* TW: Asia/Taipei
* VN: Asia/Ho\_Chi\_Minh
* UA: Europe/Kiev
* PT: Europe/Lisbon
* NL: Europe/Amsterdam
* BE: Europe/Brussels
* CH: Europe/Zurich
* GR: Europe/Athens
* FI: Europe/Helsinki
* DK: Europe/Copenhagen
* NO: Europe/Oslo
* IE: Europe/Dublin


# Discount Calculator

## /discount/calc-disc-price

This endpoint calculates the discounted price based on the original price and the discount percentage provided in the query parameters. It returns the original price, discount percentage, and the discounted price. If any of the parameters are missing, not numbers, or the discount percentage is not within the valid range (0-100), it returns a 400 error with a corresponding message.

### Query Parameters

| Parameter          | Type   | Description                                   |
| ------------------ | ------ | --------------------------------------------- |
| price              | number | The original price of the product or service. |
| discountPercentage | number | The discount percentage to be applied.        |

### Response

```json
{
  "originalPrice": "number",
  "discountPercentage": "string",
  "discountedPrice": "number"
}
```


# Discount Discover

## /discount/calc-disc

This endpoint calculates the discount percentage based on the original price and the discounted price provided in the query parameters. It returns the original price, discounted price, and the calculated discount percentage. If any of the parameters are missing, not numbers, or the discounted price is greater than or equal to the original price, it returns a 400 error with a corresponding message.

### Query Parameters

| Parameter       | Type   | Description                                     |
| --------------- | ------ | ----------------------------------------------- |
| originalPrice   | number | The original price of the product or service.   |
| discountedPrice | number | The discounted price of the product or service. |

### Response

```json
{
  "originalPrice": "number",
  "discountedPrice": "number",
  "discountPercentage": "string"
}
```


# POST Endpoints

## ZioMark's HUB Multipurpose API POST Endpoints

Welcome to ZioMark's HUB Multipurpose API! Our API offers a diverse range of functionalities accessible through `POST` requests. With these endpoints, you can perform various operations that require submitting data or performing actions on the server.

### Overview

Our API provides `POST` endpoints for a wide range of tasks, including:

* Calculating loan payments based on loan amount, interest rate, and duration.
* Generating PDF documents from HTML content.
* Creating dynamic images with customized text overlays on background images.
* Converting text to QR codes with customizable options.
* Fetching geolocation data for specified addresses.
* Uploading files and performing operations like converting Excel files to CSV format.

These endpoints allow you to interact with the API in a more interactive and dynamic manner. Whether you need to perform complex calculations, generate documents, or manipulate data, our API's `POST` endpoints provide the necessary functionality.

For detailed documentation on each endpoint, including request body formats and response formats, please refer to the corresponding sections below.


# HTML to PDF

Converts HTML content to a PDF document and uploads it to a file hosting service.

## /html-to-pdf

This endpoint converts HTML content or a webpage to a PDF file. It supports converting either a URL or raw HTML content. The endpoint uses Puppeteer to render the webpage and generate the PDF. If `upload` is set to "Yes", the generated PDF will be uploaded to a file-sharing service, and the response will contain a download link. If `upload` is set to "No", the generated PDF will be returned directly as the response. Any errors during the conversion process will result in an appropriate error response with a status code of 500.

### Request Body (htmlContent OR url)

This endpoint accepts a form-data body with the following fields:

* `url`: (string) The URL of the webpage to convert to PDF.
* `htmlContent`: (string) The raw HTML content to convert to PDF.
* `upload`: (string) Specifies whether to upload the generated PDF or not. Possible values are "Yes" or "No".

### Example:

```json
{
    "htmlContent": "<!DOCTYPE html><html><head><title>My HTML to PDF</title></head><body><h1>Hello, World!</h1></body></html>"
}
```

```json
{
    "url": "http://api.ziomark.xyz/"
}
```

{% hint style="danger" %}
With the "url" method, you cannot download heavy pages, otherwise the call will timeout
{% endhint %}

### Response

Upon successful conversion and upload, the endpoint responds with the URL to the uploaded PDF document.

### Example:

```json
{
    "download_link": "https://file.io/abc123"
}
```

{% hint style="warning" %}
Note: The files is limited to maximum 1 download and will be deleted after
{% endhint %}

### Error Responses

* **Status Code**: `500 Internal Server Error`
  * Body: "Error converting HTML to PDF"
  * Description: Occurs if there's an error during the conversion process.


# Loan Calculator

Computes monthly payments for a loan based on the loan amount, interest rate, and loan term.

## /loan-calculator

This endpoint calculates the monthly payment for a loan based on the provided loan amount, annual interest rate, and duration in years. It accepts a POST request with form data including the `loanAmount`, `annualInterestRate`, and `durationYears`. If any of the provided values are not valid numeric values, it returns a 400 error with a corresponding message. If the calculation results in a valid monthly payment, it returns the monthly payment rounded to 2 decimal places. If the calculation is invalid, it returns a 400 error with a corresponding message.

**Headers**:

* `Content-Type`: `application/x-www-form-urlencoded`

**Request Body (loanAmount, annualInterestRate, durationYears)**

Form Data:

* `loanAmount`: The amount of the loan.
* `annualInterestRate`: The annual interest rate (in percentage).
* `durationYears`: The duration of the loan in years.

**Example**:

```plaintext
loanAmount: 10000
annualInterestRate: 5
durationYears: 3
```

**Response**\
Upon successful calculation, the endpoint responds with the monthly payment amount.

**Example**:

```json
{
    "monthlyPayment": "299.71"
}
```

**Error Responses**

* **Status Code: 400 Bad Request**

  **Body**: `"Please provide valid numeric values for loan amount, interest rate, and duration."`

  **Description**: Occurs if any of the parameters are missing or not a valid number.
* **Status Code: 400 Bad Request**

  **Body**: `"Invalid calculation. Please check the input values."`

  **Description**: Occurs if the calculation cannot be completed due to invalid input values, such as an interest rate of 0% over a 0 year duration, which are not mathematically viable for the formula.

This endpoint allows for a quick calculation of the monthly payments required for a loan based on the principal amount, the interest rate, and the loan duration. The calculation assumes that payments are made monthly and that the interest is compounded monthly as well.


# Excel to CSV

### /excel-csv

This endpoint accepts a POST request with a multipart form-data body containing an Excel file. It converts the Excel file to CSV format and sends it as a downloadable file in the response. If the file is not provided, it returns a 400 error with a corresponding message. If there is an error during the conversion process, it returns a 500 error with a corresponding message.

**Headers**:

* `Content-Type`: `application/x-www-form-urlencoded`

### Request Parameters

* **File:** The Excel file to be uploaded for conversion. The file should be sent as form-data with the key `file`.

### Response

* **Success Response:**
  * **Status Code:** 200 OK
  * **Content:** The converted CSV file will be downloaded as a response.
  * **Content-Type:** `text/csv`
* **Error Response:**
  * **Status Code:** 400 Bad Request
  * **Content:** `{ "error": "No file uploaded" }` - Indicates that no file was uploaded.
  * **Status Code:** 500 Internal Server Error
  * **Content:** `{ "error": "Failed to convert to CSV" }` - Indicates an error occurred during the conversion process.

### Example Usage

**Request**

```http
POST /excel-csv
Content-Type: multipart/form-data
```

**Request Body**

```
file: <Excel file>
```

### **Response**

```http
HTTP/1.1 200 OK
Content-Disposition: attachment; filename="converted_<timestamp>.csv"
Content-Type: text/csv
```

The CSV file content will be included in the response body.

#### Notes

* The uploaded Excel file will be deleted from the server after conversion.
* The converted CSV file will be deleted from the server after download.
* Ensure that the Excel file is in the correct format (.xlsx) for successful conversion.


