I have an API, and we would like to see who uses it (well actually for the moment we just would like to see what python notebooks on github calls it). I guess I could log the IP addresses, but I would prefer the url it self, so I can backlink to all that useses the API.
Is this possible at all? The language is of less importance.
I already naively tried to use the request.referrer in Python flask, but when i call api2 it doesnt seem to work.
import requests
@app.route('/api')
def api():
return unicode(request.referrer)
@app.route('/api2')
def api2():
r = requests.get('http://omicsdriven.pythonanywhere.com/api')
return str(r.text)