DEV Community

Cover image for Feed Saxo Bank instruments price into sqlite database
Siarhei Siniak
Siarhei Siniak

Posted on

1 1

Feed Saxo Bank instruments price into sqlite database

Though Saxo Bank has dropped MetaTrader support back in 2015. Open API allows to implement a custom broker.

We are going to consider read-only mode, when price of instruments is continuously put into sqlite database.

Authentication is required prior. A user friendly token generator allows to use a single header instead.

def k1(uic, asset_type, token):
    assert re.compile(r'[a-zA-Z]+').match(asset_type)
    with requests.get(
        'https://gateway.saxobank.com/sim/openapi/ref/v1/instruments/details/%d/%s' % (
            uic,
            asset_type
        ),
        headers=dict(
            authorization='Bearer %s' % token,
        ),
    ) as p:
        market_info = p.json()
    assert 'Symbol' in market_info
    return market_info
Enter fullscreen mode Exit fullscreen mode

token is generated at https://www.developer.saxo/openapi/token/current

Available instruments vary between forex, stocks and derivatives.

Read the full article at https://product-development-service.blogspot.com/2022/06/feed-saxo-bank-instruments-price-into.html

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

Try REST API Generation for MS SQL Server.

DevOps for Private APIs. With DreamFactory API Generation, you get:

  • Auto-generated live APIs mapped from database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay