title: API data conversion in JSON and check validity
body: <p>I have a problem in the API formatted data. I am getting the data/API response from the besttime app in JSON. But when I copy that data in the <code>https://jsonlint.com/</code> it's showing it is invalid JSON. I also want to save the response as JSON in a local file.</p>
  <pre><code>import requests
  import pandas as pd
  url = &quot;https://besttime.app/api/v1/forecasts&quot;
  # List with multiple venues in tuples
  venue_list = [
  (&quot;Simple Pleasures Cafe&quot;,&quot;3434 Balboa St, San Francisco, CA 94121, United States&quot;),
  ]
  for venue in venue_list:
      params = {
          'api_key_private': 'pri_e444ac582fsfg9fre4459909b7b753c5c45cbe6a',
          'venue_name': venue[0],
          'venue_address': venue[1]
      }
      response = requests.request(&quot;POST&quot;, url, params=params)
      print(response.json())
  </code></pre>
  <p>Please check the below JSON response I am getting</p>
  <pre><code>{'status': 'OK', 'epoch_analysis': '1627589243', 'venue_info': {'venue_id': 'ven_554f58764a45447a416b3152415968487956516f4264374a496843', 'venue_name': &quot;Pasquale's Pizzeria&quot;, 'venue_address': '700 Irving St San Francisco, CA 94122 United States', 'venue_timezone': 'America/Los_Angeles', 'venue_dwell_time_min': 20, 'venue_dwell_time_max': 20, 'venue_dwell_time_avg': 20, 'venue_type': 'RESTAURANT', 'venue_types': ['pizza_restaurant', 'italian_restaurant', 'meal_delivery']}, 'analysis': [{'day_info': {'day_int': 0, 'day_text': 'Monday', 'venue_open': 11, 'venue_closed': 0, 'day_rank_mean': 7, 'day_rank_max': 7, 'day_mean': 1, 'day_max': 3}, 'busy_hours': [], 'quiet_hours': [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0], 'peak_hours': [], 'surge_hours': {'most_people_come': 15, 'most_people_leave': 18}, 'hour_analysis': [{'hour': 6, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 7, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 8, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 9, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 10, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 11, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 12, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 13, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 14, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 15, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 16, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 17, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 18, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 19, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 20, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 21, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 22, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 23, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 0, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 1, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 2, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 3, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 4, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 5, 'intensity_txt': 'Closed', 'intensity_nr': '999'}], 'day_raw': [0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0]}, {'day_info': {'day_int': 1, 'day_text': 'Tuesday', 'venue_open': 11, 'venue_closed': 0, 'day_rank_mean': 6, 'day_rank_max': 6, 'day_mean': 32, 'day_max': 52}, 'busy_hours': [12], 'quiet_hours': [21, 22, 23, 0], 'peak_hours': [{'peak_start': 11, 'peak_max': 12, 'peak_end': 18, 'peak_intensity': 3, 'peak_delta_mean_week': 17}], 'surge_hours': {'most_people_come': 11, 'most_people_leave': 20}, 'hour_analysis': [{'hour': 6, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 7, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 8, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 9, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 10, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 11, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 12, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 13, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 14, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 15, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 16, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 17, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 18, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 19, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 20, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 21, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 22, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 23, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 0, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 1, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 2, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 3, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 4, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 5, 'intensity_txt': 'Closed', 'intensity_nr': '999'}], 'day_raw': [0, 0, 0, 0, 0, 45, 50, 50, 40, 35, 35, 35, 35, 30, 20, 15, 5, 5, 0, 0, 0, 0, 0, 0]}, {'day_info': {'day_int': 2, 'day_text': 'Wednesday', 'venue_open': 11, 'venue_closed': 0, 'day_rank_mean': 2, 'day_rank_max': 3, 'day_mean': 44, 'day_max': 65}, 'busy_hours': [16, 17, 18, 19], 'quiet_hours': [23, 0], 'peak_hours': [{'peak_start': 11, 'peak_max': 17, 'peak_end': 21, 'peak_intensity': 3, 'peak_delta_mean_week': 30}], 'surge_hours': {'most_people_come': 11, 'most_people_leave': 20}, 'hour_analysis': [{'hour': 6, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 7, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 8, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 9, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 10, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 11, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 12, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 13, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 14, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 15, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 16, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 17, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 18, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 19, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 20, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 21, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 22, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 23, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 0, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 1, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 2, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 3, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 4, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 5, 'intensity_txt': 'Closed', 'intensity_nr': '999'}], 'day_raw': [0, 0, 0, 0, 0, 35, 45, 45, 45, 50, 55, 65, 65, 60, 45, 35, 20, 10, 0, 0, 0, 0, 0, 0]}, {'day_info': {'day_int': 3, 'day_text': 'Thursday', 'venue_open': 11, 'venue_closed': 0, 'day_rank_mean': 5, 'day_rank_max': 5, 'day_mean': 38, 'day_max': 56}, 'busy_hours': [14, 15, 16], 'quiet_hours': [22, 23, 0], 'peak_hours': [{'peak_start': 11, 'peak_max': 15, 'peak_end': 19, 'peak_intensity': 3, 'peak_delta_mean_week': 21}], 'surge_hours': {'most_people_come': 11, 'most_people_leave': 22}, 'hour_analysis': [{'hour': 6, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 7, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 8, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 9, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 10, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 11, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 12, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 13, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 14, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 15, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 16, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 17, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 18, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 19, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 20, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 21, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 22, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 23, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 0, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 1, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 2, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 3, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 4, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 5, 'intensity_txt': 'Closed', 'intensity_nr': '999'}], 'day_raw': [0, 0, 0, 0, 0, 30, 40, 50, 55, 55, 55, 50, 40, 35, 35, 30, 20, 5, 0, 0, 0, 0, 0, 0]}, {'day_info': {'day_int': 4, 'day_text': 'Friday', 'venue_open': 11, 'venue_closed': 1, 'day_rank_mean': 2, 'day_rank_max': 2, 'day_mean': 44, 'day_max': 70}, 'busy_hours': [15, 16, 17, 18, 19, 20], 'quiet_hours': [23, 0, 1], 'peak_hours': [{'peak_start': 11, 'peak_max': 18, 'peak_end': 21, 'peak_intensity': 4, 'peak_delta_mean_week': 35}], 'surge_hours': {'most_people_come': 11, 'most_people_leave': 21}, 'hour_analysis': [{'hour': 6, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 7, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 8, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 9, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 10, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 11, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 12, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 13, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 14, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 15, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 16, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 17, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 18, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 19, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 20, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 21, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 22, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 23, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 0, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 1, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 2, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 3, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 4, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 5, 'intensity_txt': 'Closed', 'intensity_nr': '999'}], 'day_raw': [0, 0, 0, 0, 0, 30, 40, 45, 50, 50, 60, 65, 70, 65, 55, 40, 25, 15, 5, 0, 0, 0, 0, 0]}, {'day_info': {'day_int': 5, 'day_text': 'Saturday', 'venue_open': 11, 'venue_closed': 1, 'day_rank_mean': 3, 'day_rank_max': 1, 'day_mean': 43, 'day_max': 100}, 'busy_hours': [16, 17, 18, 19], 'quiet_hours': [22, 23, 0, 1], 'peak_hours': [{'peak_start': 11, 'peak_max': 17, 'peak_end': 21, 'peak_intensity': 5, 'peak_delta_mean_week': 65}], 'surge_hours': {'most_people_come': 16, 'most_people_leave': 18}, 'hour_analysis': [{'hour': 6, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 7, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 8, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 9, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 10, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 11, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 12, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 13, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 14, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 15, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 16, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 17, 'intensity_txt': 'High', 'intensity_nr': 2}, {'hour': 18, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 19, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 20, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 21, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 22, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 23, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 0, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 1, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 2, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 3, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 4, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 5, 'intensity_txt': 'Closed', 'intensity_nr': '999'}], 'day_raw': [0, 0, 0, 0, 0, 30, 40, 45, 45, 50, 75, 100, 65, 55, 50, 35, 15, 5, 5, 0, 0, 0, 0, 0]}, {'day_info': {'day_int': 6, 'day_text': 'Sunday', 'venue_open': 11, 'venue_closed': 0, 'day_rank_mean': 4, 'day_rank_max': 4, 'day_mean': 42, 'day_max': 61}, 'busy_hours': [17, 18, 19], 'quiet_hours': [23, 0], 'peak_hours': [{'peak_start': 11, 'peak_max': 18, 'peak_end': 21, 'peak_intensity': 3, 'peak_delta_mean_week': 26}], 'surge_hours': {'most_people_come': 11, 'most_people_leave': 21}, 'hour_analysis': [{'hour': 6, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 7, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 8, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 9, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 10, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 11, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 12, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 13, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 14, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 15, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 16, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 17, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 18, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 19, 'intensity_txt': 'Above average', 'intensity_nr': 1}, {'hour': 20, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 21, 'intensity_txt': 'Average', 'intensity_nr': 0}, {'hour': 22, 'intensity_txt': 'Below average', 'intensity_nr': -1}, {'hour': 23, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 0, 'intensity_txt': 'Low', 'intensity_nr': -2}, {'hour': 1, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 2, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 3, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 4, 'intensity_txt': 'Closed', 'intensity_nr': '999'}, {'hour': 5, 'intensity_txt': 'Closed', 'intensity_nr': '999'}], 'day_raw': [0, 0, 0, 0, 0, 30, 45, 50, 45, 45, 50, 60, 60, 55, 45, 30, 20, 10, 0, 0, 0, 0, 0, 0]}], 'api_key_private': 'pri_e444ac582f9f4909b7b753c5c45cbe6a'}
  
  {'epoch': '1627589312', 'message': 'Error: Venue found, but could not forecast this venue. Potential issues: This place closed for the whole week, is too new, or not does not have enough volume (visitors) to make a forecast.', 'status': 'error', 'venue_info': {'venue_address': '1000a 3rd St San Francisco, CA 94158 United States', 'venue_name': 'Little Creatures Brewing Mission Bay'}}
  
  {'epoch': '1627589315', 'message': 'Error: Venue found, but could not forecast this venue. Potential issues: This place closed for the whole week, is too new, or not does not have enough volume (visitors) to make a forecast.', 'status': 'error', 'venue_info': {'venue_address': '700 Post St San Francisco, CA 94109 United States', 'venue_name': 'Beyond Burma'}}
  </code></pre>