Skip to content

indoben/forex-12data-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forex App - 12data API Tester

A Python application to test and interact with the Twelve Data (12data) API.

Features

  • Twelve Data API: Retrieve time series data, real-time prices, and forex quotes
  • Easy-to-use class for API interactions
  • Support for multiple symbols and intervals

Setup

  1. Install dependencies:

    pip install -r requirements.txt
  2. Set up environment variables:

    cp .env.example .env

    Then edit .env and add your Twelve Data API key:

    TWELVE_DATA_API_KEY=your_actual_api_key_here
    

    Get your free API key from: https://twelvedata.com/

Usage

Run the test script:

python app.py

Use as a module:

from app import TwelveDataTester
import os

# Twelve Data
td = TwelveDataTester(api_key=os.getenv("TWELVE_DATA_API_KEY"))
price_data = td.get_real_time_price("AAPL")
print(price_data)

# Forex quote
forex = td.get_forex_quote("EUR", "USD")
print(forex)

# Time series data
ts_data = td.get_time_series("AAPL", interval="1day", outputsize=10)
print(ts_data)

API Details

Twelve Data

  • Official API client
  • Requires API key (free tier available)
  • Supports time series data, real-time prices, and forex quotes
  • Multiple intervals: 1min, 5min, 15min, 30min, 45min, 1h, 2h, 4h, 1day, 1week, 1month

Requirements

  • Python 3.7+
  • twelvedata
  • python-dotenv
  • requests

Notes

  • Be aware of rate limits for Twelve Data API
  • Always verify data accuracy before making trading decisions

About

Testing the data api from Twelve Data

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages