0

I am trying to scrape questions related to Python from Stackoverflow using STACKEXCHANGE API between two given dates. I was accessing the data without key. Then I faced throttling issue and was banned for 20 hours. I read the documentation of Stack API and came to know about the API_Key. Now I am using API_Key, the problem I am facing is when I run the fetch command using following code:

questions = SITE.fetch('questions',tagged='python',fromdate=from_date, todate=today,filter='withbody')

I am getting

error 400, 'bad_parameter'

on fromdate. However, when I remove the API_Key and run the above command, it works fine. Could anyone guide me where am I making mistake step?

user2293224
  • 2,128
  • 5
  • 28
  • 52

1 Answers1

0

I figured out the issue. Without Key, you can enter the values of fromdate and todate in standard date formats (i.e. yyyy-mm-dd or dd-mm-yyyy). However, when we use Key parameter then values of fromdate and todate should be in Unix epoch time format which is integer value of time.

user2293224
  • 2,128
  • 5
  • 28
  • 52