title: KeyError: 'apikey'
body: <p>This is what the code is but getting keyerror &quot;apikey&quot;</p>
  <p>class Firebase:
  &quot;&quot;&quot; Firebase Interface &quot;&quot;&quot;
  def <strong>init</strong>(self, config):</p>
  <pre><code>    self.api_key = config[&quot;apikey&quot;]
      self.auth_domain = config[&quot;authDomain&quot;]
      self.database_url = config[&quot;databaseURL&quot;]
      self.storage_bucket = config[&quot;storageBucket&quot;]
      self.credentials = None
      self.requests = requests.Session()
      if config.get(&quot;serviceAccount&quot;):
          scopes = [
              'https://www.googleapis.com/auth/firebase.database',
              'https://www.googleapis.com/auth/userinfo.email',
              &quot;https://www.googleapis.com/auth/cloud-platform&quot;
          ]
          service_account_type = type(config[&quot;serviceAccount&quot;])
          if service_account_type is str:
              self.credentials = ServiceAccountCredentials.from_json_keyfile_name(config[&quot;serviceAccount&quot;], scopes)
          if service_account_type is dict:
              self.credentials = ServiceAccountCredentials.from_json_keyfile_dict(config[&quot;serviceAccount&quot;], scopes)
      if is_appengine_sandbox():
          # Fix error in standard GAE environment
          # is releated to https://github.com/kennethreitz/requests/issues/3187
          # ProtocolError('Connection aborted.', error(13, 'Permission denied'))
          adapter = appengine.AppEngineAdapter(max_retries=3)
      else:
          adapter = requests.adapters.HTTPAdapter(max_retries=3)
  
      for scheme in ('http://', 'https://'):
          self.requests.mount(scheme, adapter)
  </code></pre>