quantified-uncertainty / metaforecast

Fetch forecasts from prediction markets/forecasting platforms to make them searchable. Integrate these forecasts into other services.
https://metaforecast.org/
MIT License
56 stars 5 forks source link

Insight prediction API produces an error when ordering markets by is_resolved #94

Open NunoSempere opened 1 year ago

NunoSempere commented 1 year ago

What I was expecting

From the documentation, I was expecting the following to work

INSIGHT_BEARER='abcdxyz123'
 curl --request GET --get "https://insightprediction.com/api/markets?orderBy=is_resolved&sortedBy=desc" --header "Authorization: Bearer $INSIGHT_BEARER" --header "Content-Type: application/json" --header "Accept: application/json"

I was also expecting something like

INSIGHT_BEARER='abcdxyz123'
 curl --request GET --get "https://insightprediction.com/api/markets?page=2&orderBy=is_resolved&sortedBy=desc" --header "Authorization: Bearer $INSIGHT_BEARER" --header "Content-Type: application/json" --header "Accept: application/json"

to work.

What I got instead

Neither request does work. In curl, they return a

{
    "message": "Server Error"
}

(in node, this is a "Error: Request failed with status code 500")

What does work

The following does work:

INSIGHT_BEARER='abcdxyz123'
 curl --request GET --get "https://insightprediction.com/api/markets?page=2" --header "Authorization: Bearer $INSIGHT_BEARER" --header "Content-Type: application/json" --header "Accept: application/json"

but doesn't return results ordered by is_resolved.

NunoSempere commented 1 year ago

Resolved now as the Insight prediction API has been updated.