The function of getting the period of a user's following

Thank you! But how to use these urls in python script?