Sounds like an api that would be language agnostic, probably json or XML, so learning any language is equally valid.
If your focus is web, JS over Python makes sense. There are no firm rules. Learn the basics with whatever makes sense to you. Then grow from that.
Python can do it but you’d want to use the Requests module: