I'm trying to fetch the stats (amount raised, remaining time) of specific crowdloan using Polkadot.js API however I can't find any examples or docs explaining the crowdloan queries.

It is certainly possible as Polkadot.js app shows this under /apps/#/parachains/crowdloan path.

Anyone has example how to get this data?

1 Answer 1


If for example you are interested in fetching the stats you mentioned for the paraId = 2037 in Polkadot, then you could try running the following example code in Polkadot-js apps > Developer menu > Javascript submenu :

const paraInfo = await api.query.crowdloan.funds(2037);
console.log(JSON.stringify(paraInfo, null, 4));

and it will give you the following result :

    "depositor": "14bEKMdGLwGKNTz4BtT7venXZ4RcXdGfBSdEYrJLPNoHRvoK",
    "verifier": null,
    "deposit": 5000000000000,
    "raised": "0x0000000000000000001b1201976cc6ed",
    "end": 10881401,
    "cap": "0x00000000000000000214e8348c4f0000",
    "lastContribution": {
        "ending": 9829425
    "firstPeriod": 8,
    "lastPeriod": 15,
    "fundIndex": 31

I think you are interested in the values associated with the keys raised and end ?

  • Thanks! Let me try that!
    – Jan Kraus
    Commented Apr 11, 2022 at 18:41
  • This worked perfectly! Is there any link to docs where this is documented?
    – Jan Kraus
    Commented Apr 12, 2022 at 0:19
  • 1
    It is not documented but we are thinking of adding some queries related to parachains and crowdloans. Until then, when you face a similar issue, you could try searching in polkadot-js api repo with keywords related to your question. In this case if you search with keywords crowdloan info or crowdloan query the result is this line https://github.com/polkadot-js/api/blob/3ded30a0f308b5954bd9c2c0ff91abf81a273d67/packages/api-derive/src/crowdloan/childKey.ts#L38 which gives you the actual query you need to do. Or you can always post a question here and someone will be happy to help :)
    – dominique
    Commented Apr 12, 2022 at 7:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.