Skip to content

Custom sources: support POST requests with a JSON body

Feedback and ideasStarted by @turbo2 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.

2 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.

Sign in to reply with your Turbobulls account.