title: Extracting "title" data from JSON
body: <p>i have this API..</p>
  
  <p><a href="https://manager.upbit.com/api/v1/" rel="nofollow noreferrer">https://manager.upbit.com/api/v1/</a></p>
  
  <p>and I want to extract the title from it and compare it to see if there are any changes or updates to api ... i am getting error</p>
  
  <pre><code>before_set = before['data']['title']
  KeyError: 'title'
  </code></pre>
  
  <p>my code is the following:</p>
  
  <pre><code>import requests
  import json
  
  try:
      with open('notice.json', 'r') as current_notice:
          before = json.loads(current_notice.read())
  except IOError:
      before = requests.get('https://manager.upbit.com/api/v1/').json()
      with open('notice.json', 'w') as current_notice:
          current_notice.write(json.dumps(before))
      print("First run....")
  
  after = requests.get('https://manager.upbit.com/api/v1/').json()
  
  before_set = before['data']['title']
  after_set = after['data']['title']
  
  new_set = after_set - before_set
  
  while True:
      try:
          if not new_set:
              print("No change... Exiting.")
          if new_set:
              print("There are changes")
      except Exception as e:
          print(e)
          pass       
  </code></pre>