Anyone using gmail API to grab emails and have a good way to get all of the key:value pairs out of the header?

So gmail doesn’t make it easy to get the email details. They’re sticking most of the fields into a header object with key:value pairs and I’m struggling in trying to figure out how to parse this in my API workflow

"payload": {
    "mimeType": "text/plain", 
    "headers": [
      {
        "name": "Delivered-To", 
        "value": "[email protected]"
      }, 
      {
        "name": "To", 
        "value": "[email protected]"
      }, 
      {
        "name": "Subject", 
        "value": "A test email"
      },  
      {
        "name": "Date", 
        "value": "Mon, 25 Mar 2019 12:50:13 +0000 (UTC)"
      }
    ], 
    "body": {
      "data": "VGltZTogICAgICAgICBNb24gTWFyIDI1IDEyOjUwOjEzIDIwMTkgKzAwMDANCkFjY291bnQ6ICAgICAgcG9zdGZpeA0KUmVzb3VyY2U6ICAgICBQcm9jZXNzIF", 
      "size": 124
    }, 
    "partId": "", 
    "filename": ""
	},

Here’s a screenshot where I want to grab the Subject, but from my API call I only get name or value from a key:value pair and I need to grab the value from Name = Subject.

Hey Keith,

Not at my desk to test, but how about headers : filtered where name equals Subject : first item > value?

–Ken