To interact with an online resource in general, it's usually best to set up a REST API that can be contacted using HTTPRequest. Developing the API itself is out of the scope of this question, but pretty much any Web framework can be used for this. Microframeworks such as Flask tend to be popular for this use case.
In your case, your API will need to have one endpoint that will modify the JSON file when it's called. Remember that you will probably need to set up some sort of authentication mechanism too.