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
?