Python Example
See our full reference implementation here.
Note: This page assumes you are using MacOS or Linux. See the reference implementation for Windows instructions.
Step 1: Create a virtual environment
python3 -m venv venv
source venv/bin/activate
# Add Buf registry to virtual environment
printf "
[global]
extra-index-url = https://buf.build/gen/python
" > venv/pip.confStep 2: Add required dependencies
pip install fxnlabs-api-gateway-community-danielgtaylor-betterproto
pip install grpclibStep 3: Create the API Client
api_key = 'MY_FXN_API_KEY'
channel = Channel('api.fxnrouter.com')
client = APIGatewayServiceStub(channel, metadata=[('authorization', f'Bearer {api_key}')])