title: How to load JSON data (call from API) without key directly to S3 bucket using Python?
body: <p>I am relatively new to AWS <code>s3</code> I am calling an API to load the JSON data directly to <code>s3</code> bucket. From <code>s3</code> bucket data will be read by <code>Snowflake</code>. After researching I found that using <code>Boto3</code> we can load data into <code>s3</code> directly. Code will look something like below, however one thing I am not sure about is What should I put for the key as there is no object created in my <code>S3</code> bucket. Also, what is the good practice to load the JSON data to <code>s3</code> ? Do I need to encode JSON data to 'UTF-8' as done <a href="https://stackoverflow.com/questions/46844263/writing-json-to-file-in-s3-bucket">here</a> by SO user Uwe Bretschneider.</p>
  <p>Thanks in advance!</p>
  <p><strong>Python code:</strong></p>
  <pre><code>import json,urllib.request
  import boto3
  data = urllib.request.urlopen(&quot;https://api.github.com/users?since=100&quot;).read()
  output = json.loads(data) 
  print (output) #Checking the data
  
  
  s3 = boto3.client('s3')
  s3.put_object(
       Body=str(json.dumps(data))
       Bucket='I_HAVE_BUCKET_NAME'
       Key='your_key_here'
  )
  </code></pre>