import requests
from fake_useragent import UserAgent
import json
ua = UserAgent()
def collect_data():
resource = requests.get(
url='https://market.csgo.com/api/v2/prices/RUB.json',
headers={'user-agent': f'{ua.random}'}
)
with open('tm.json','w') as file:
json.dump(resource.json(), file, indent=4, ensure_ascii=False)
def main():
collect_data()
if __name__ == '__main__':
main()