That is not available from the API. At best you get your own reputation:
/2.2/users/841108?order=desc&sort=reputation&site=stackoverflow&filter=!LnNkvsiMoAuboSNHiWK3fq
{
"reputation_change_year": 5880,
"reputation_change_quarter": 3570,
"reputation_change_month": 1007,
"reputation_change_week": 29,
"reputation_change_day": 30,
"reputation": 195027,
"user_id": 841108,
"link": "https://stackoverflow.com/users/841108/basile-starynkevitch",
"display_name": "Basile Starynkevitch"
}
but there is no other endpoint that returns your position in relation to other users.
An alternative is this SEDE query but that is not easy to automate as SEDE lacks a proper API. You have to script that.
;with league as
(
select rank() over (order by reputation desc) [ranking]
, id
, reputation
from users where reputation > 199
)
select ranking
, ranking / convert(decimal,(select count(*) from league )) *100
from league
where id = ##userid?841108:int##
This is the result today:

SEDE is updated on Sunday.
https://api.stackexchange.com/2.2/users/841108?order=desc&sort=reputation&site=stackoverflow&filter=!)scTwI3i00OtODDTSG5u
. Total reputation is not available in the API. You could do a SEDE query but that one is hard to automate as it lacks a proper API