How do I get a specific value from an api?

I’m trying to get the “estSubCount” from https://axern.space/api/get?platform=youtube&type=channel&id=$(userid) but idk how get get that value in the command instead of the api values.

I think this should work in theory

!addcom !subs $(eval x=$(urlfetch https://axern.space/api/get?platform=youtube&type=channel&id=$(userid)); x[‘estSubCount’])

edit:

!addcom !subs $(eval x=$(urlfetch json https://axern.space/api/get?platform=youtube&type=channel&id=$(userid)); x['estSubCount'])

Thanks, it worked! Ive been wanting to know how to get that for ages.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.