MetaCopier
Open appSupport
  • 📄Documentation
  • 💟Introduction
  • Features
    • 💼Basic features
    • 🌟Pro features
    • 🔀Signal sharing
    • 🏎️HFT support
    • 💢Specifications
  • ⛳Pending orders
  • Tutorials
    • 🚀Quick start guide
    • 📈Set up strategy
    • ➡️Connect TradingView
    • 💰Prop firms guide
    • 🖥️For developers
    • 🔍Regex
    • ⏳Cron expressions
    • 🏠My home IP
  • B2B
    • 👨‍💼Business-to-Business
    • 🏷️White label
  • MetaCopier
    • 🧑‍🤝‍🧑Affiliate Program
    • Frequently Asked Questions (FAQ)
    • ⛑️Troubleshooting
    • 💠App
    • 💲Billing
    • 💳Payment methods
    • 🤝Support
    • 🚧Feature request
    • 🚀Release notes
  • REST API
    • ✨SDK
      • Usage
        • C#
        • Java
        • Typescript
        • Python
        • Other
      • Generation
    • 💡API
      • Swagger
      • Readme.io
    • 🗒️Changes
  • Socket API
    • 💡API
    • 🗒️Changes
Powered by GitBook
On this page
  • Create API Key from metacopier.io
  • Package Information
  • Option 1: Install with python package index (PyPi.org)
  • Options 2: Install with OpenAPI Generator CLI
  • Example
  • Generate your own package
  • What endpoints can I call?

Was this helpful?

  1. REST API
  2. SDK
  3. Usage

Python

Instructions on how to install and use the MetaCopier API Client package

PreviousTypescriptNextOther

Last updated 5 months ago

Was this helpful?

Create API Key from metacopier.io

To generate yourself an API Key please navigate to metacopier.io > Your Projects > (Choose a project) > API Keys

Note: Please do not share your API Key to people whom you don't trust.

Package Information

Both packages from option 1 or option 2 are based on the following OpenAPI configuration:

Option 1: Install with python package index (PyPi.org)

Execute install command

Execute the following command to generate the SDK package:

pip install metacopier-api

You can also visit the package on the official PyPI site:

Options 2: Install with OpenAPI Generator CLI

See instructions under Generation

Execute CLI command

Execute the following command to generate the SDK package:

openapi-generator-cli generate -i https://api.metacopier.io/rest/api/documentation/v3/api-docs -g python --additional-properties packageName=metacopier_api

Example

In the following python program I will use the metacopier_api (OpenCLI or PyPI) package to fetch all accounts of my MetaCopier project.

from metacopier_api.api.account_api_api import AccountAPIApi
from metacopier_api.api_client import ApiClient
from metacopier_api.configuration import Configuration
from metacopier_api.exceptions import ApiException

# Api Key from metacopier.io
apiKey = "YOUR_API_KEY"

configuration = Configuration(
    host = "https://api.metacopier.io"
)

# Set api key for authorization
configuration.api_key['ApiKeyAuth'] = apiKey

# USe Api Client
with ApiClient(configuration) as api_client:

    # Create an instance of the account API class
    accountClient = AccountAPIApi(api_client)

    try:
        # Send request to fetch accounts
        accounts = accountClient.get_accounts()
        
        # Print response
        print(accounts)
    except ApiException as e:
        print("Exception when calling AccountAPIApi: %s\n" % e)
        

Generate your own package

With the following command, you can generate your own package for the metacopier api:

Be sure that you have installed the OpenAPI Generator. See Generation page for more information.

openapi-generator-cli generate -i https://api.metacopier.io/rest/api/documentation/v3/api-docs -g python

For more information regarding the Open API generator, please visit their offical page:

What endpoints can I call?

To check all available endpoints see either of the two pages:

✨
Readme.io
Swagger
https://api.metacopier.io/rest/api/documentation/v3/api-docsapi.metacopier.io
Hello from OpenAPI Generator | OpenAPI Generator
Logo
metacopier-apiPyPI
Logo