2. API Integration Example

This example shows how to fetch data from an API using the Vortex Tool module.


from vortex import Vortex
from vortex.Tool import get_data_from_api

def fetch_api_data():
    api_data = get_data_from_api("endpoint", "your_api_key", "your_private_key", "your_address", "Aptos")
    print(api_data)

fetch_api_data()

In this example:

  • API Data Fetching: The get_data_from_api function is used to retrieve data from the specified API endpoint.

  • Parameters:

    • "endpoint": The API endpoint URL or path.

    • "your_api_key": Your API key for authentication.

    • "your_private_key": Your private key.

    • "your_address": Your address.

    • "Aptos": The blockchain chain information.

  • Output: The fetched API data is printed to the console.

These examples should help you get started with VortexEngine and integrate it with external APIs. Adjust the parameters and configurations as needed for your specific use case.

Last updated