I'm using Shodan's API https://developer.shodan.io/api to get my current network alerts. I want to parse out the id for the alerts with jq.
The curl request is curl -X GET -i https://api.shodan.io/shodan/alert/info?key={API KEY}
The output of that request is json data fomatted like so:
[
{
"name": "Test Alert",
"created": "2017-01-09T21:53:17.104000",
"expires": 0,
"expiration": null,
"filters": {
"ip": [
"198.20.88.870"
]
},
"id": "HKVGCP1WD79Z7W2T",
"size": 1
}
]
Using curl -X GET -i https://api.shodan.io/shodan/alert/info?key={API KEY} | jq '.id' give the following error:
"parse error: Invalid numeric literal at line 1, column 9"