Skip to content

Custom sources: support POST requests with a JSON body

Feedback and ideasStarted by @turbo5 replies

Founding memberIdea makerBug hunter

Custom sources can only use GET. Some official price sources only answer POST. Example: a Mexican fund price service (gafplataforma.com.mx) whose price history endpoint takes a JSON body with operator, fund, series and a date range. A GET to the same address redirects to a login page.

Request: an optional method (GET or POST) and an optional request body for custom sources, with the same placeholders as the address ({SYMBOL}, {FROM}, {TO}, {FROM_UNIX}, {TO_UNIX}, {KEY}), filled and escaped as JSON strings. Content-Type would be set by the Connector (application/json), since it is a forbidden header today.

It would also help if {SYMBOL} could carry more than one value (for example fund and series separated by a character the source definition splits on), so one source can serve many funds instead of one source per fund, given the limit of 12 custom sources.

From the Turbobulls guides

5 replies

  1. Staff

    Thank you for the worked example, it makes this very concrete.

    Custom sources only send GET requests on purpose. A GET only reads; a POST is how a site receives something, like a form or an order. The Connector refreshes your linked assets on its own whenever the app is open, and it cannot tell a POST that only asks for prices from one that changes something. Staying with GET means a source can never do more than read.

    For the same reason it never sends cookies or follows redirects. So if that endpoint only answers when you are logged in, a POST from the Connector would not get through either. If you can try a POST to it without being logged in (curl is enough), I would love to know what it answers.

    The Connector is open source, so you can see exactly how it handles requests: turbobulls-extension on GitHub. We will look into whether POST can be added safely, and I will come back here with what we find.

    On the limit of 12: one source already serves any number of assets, each with its own symbol. Only a second value per fund, like the series, needs separate sources, and we will look at that too.

  2. Founding memberIdea makerBug hunterAuthor

    Thanks. It answers without being logged in: in my tests, this exact POST with no cookies and no session returns the price history as JSON. Only a GET to the same address redirects to the login page.

    Body sent: {"IdOperator":"1","IdEntity":"40","Id_TypeEntity":0,"Serie":"E","StartDate":"2026-10-01T00:00:00.000Z","EndDate":"2026-11-06T23:59:59.000Z","_search":false,"rows":100,"page":1,"sidx":"strId","sord":"asc"} Address: https://www.gafplataforma.com.mx//Home/constPrice (with the double slash) Content-Type: application/json

    Understood on the 12 sources: one per currency covers most of it. The second value per fund matters only for sources like this one.

    1 reply to @turbo
    1. Staff

      That settles the first question, thank you for testing it. The Connector never sends cookies, so a POST that answers with no session is one it could use, and this source is a real case for it.

      What is left is on our side, and we are looking into it now: whether a source can send a POST and still never do more than read. I will come back here with the answer, whichever way it goes.

      Good to know that one source per currency covers most of your funds. I will treat the second value as part of the same question, since it only matters for sources like this one.

  3. Staff

    I promised you an answer: sources stay GET only for now. Only the site decides what a POST does, so the Connector could never promise that a POST only reads, and it repeats its requests on its own.

    You can still keep these funds up to date today. A source can read any https:// address that answers JSON or CSV, including one you publish yourself, so a small script of your own can ask that site and publish the prices. The symbol can then carry both values, for example 40-E, so one source serves all your funds. Please check first that the site's terms allow it.

    If more members need POST, we will look at it again. Let me know how it goes.

    1 reply to @holdmybeta

Join the conversation

Use your Turbobulls account. Only your handle is ever shown.

Sign in to reply