title: How to fetch API Key using aws CLI
body: <p>I have a script where I want to fetch the AWS API gateway ID and API key value. So far I have been able to get the API gateway ID using the cli:      </p>
  
  <pre><code>aws apigateway get-api-keys --query 'items[?name==`my-api-key-name`].id' --output text --region us-east-1
  </code></pre>
  
  <p>But I am unable to fetch the value of API key. I have tried the following cli, but no luck:</p>
  
  <pre><code>aws apigateway get-api-keys --query 'items[?name==`my-api-key-name`].value' --output text --region us-east-1
  </code></pre>
  
  <p>Can someone assist me on this please?</p>