Advertisement
skip420

API_Amazon_scraper

Mar 29th, 2020
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. # API Amazon Scraper
  2. # www.rainforestapi.com
  3.  
  4.  
  5.  
  6.  
  7. import requests
  8. import csv
  9. # set up the request parameters
  10. params = {
  11.   'api_key': 'C5EE46DD672E4F9386CA39EC3F66876B',
  12.   'type': 'search',
  13.   'customer_location': 'us',
  14.   'cache_max_age_minutes': '5',
  15.   'amazon_domain': 'amazon.com',
  16.   'output': 'csv',
  17.   'search_term': 'metabolism booster',
  18.   'page': '1',
  19.   'total_pages': '10'
  20. }
  21.  
  22. # make the http GET request to Rainforest API
  23. api_result = requests.get('https://api.rainforestapi.com/request', params)
  24.  
  25. # print the CSV response from Rainforest API
  26. print(api_result.content)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement