Json pulling multiple data from an array with one api call

Hi

fairly new to Json & have a quick question on pulling multiple info from an array so here my query

formual
=Dump(JsonPathOnUrl(B3,$J$3),TRUE)

$J$3 = API Url
b3 = $..emails[*].value

this works to bring me back all the email from the api

but i also want the name first name

$J$3 = API Url
b3 = $..emails[*].first_name

and this work for the first name what I'm having trouble with is doing this in one API call instead of two so i think i'm after some sort of "AND" statement for example:

$J$3 = API Url
b3 = $..emails[].first_name "&&" $..emails[].value

but have no idea on how to write this thanks in advance for any help,

thanks Rob

Hi,

This should be possible. It works for Xpath with a "|" separator the desired targets. Do you have an example URL/API request to try on?

Another option is to fetch the entire array and use regex and StringSplit to get both Url and first_name.

Hey thanks for the reply
i've tried "|" I.e $..emails[].first_name|$..emails[].value which didn't bring me back any results, i can get what i need via =DownloadString & some funky excel search functions (very messy) will give the other method a try in the meantime an example array in below. Happy to share the completed sheet for anyone who helps me.

----- Array -----------
{
"data": {
"domain": "mybump2baby.com",
"webmail": false,
"pattern": "{first}",
"organization": null,
"emails": [
{
"value": "carla@mybump2baby.com",
"type": "personal",
"confidence": 96,
"sources": [
{
"domain": "culturebaby.co.uk",
"uri": "http://culturebaby.co.uk",
"extracted_on": "2017-08-05",
"still_on_page": true
},
{
"domain": "mybump2baby.com",
"uri": "http://mybump2baby.com/category/carlas-blog",
"extracted_on": "2017-03-25",
"still_on_page": true
},
{
"domain": "mybump2baby.com",
"uri": "http://mybump2baby.com/be-afraid-be-very-afraid",
"extracted_on": "2017-03-25",
"still_on_page": true
},
{
"domain": "mybump2baby.com",
"uri": "http://mybump2baby.com/listings/toddler-rhyme-time",
"extracted_on": "2017-03-25",
"still_on_page": true
},
{
"domain": "mybump2baby.com",
"uri": "http://mybump2baby.com/listings/baby-bounce-rhyme",
"extracted_on": "2017-03-25",
"still_on_page": true
}
],
"first_name": "Carla",
"last_name": "Lett",
"position": null,
"linkedin": null,
"twitter": null,
"phone_number": null
},
{
"value": "info@mybump2baby.com",
"type": "generic",
"confidence": 89,
"sources": [
{
"domain": "mybump2baby.com",
"uri": "http://mybump2baby.com/terms-and-conditions",
"extracted_on": "2017-03-25",
"still_on_page": true
},
{
"domain": "mybump2baby.com",
"uri": "http://mybump2baby.com/acceptable-use-policy",
"extracted_on": "2017-03-25",
"still_on_page": true
}
],
"first_name": null,
"last_name": null,
"position": null,
"linkedin": null,
"twitter": null,
"phone_number": null
}
]
},
"meta": {
"results": 2,
"limit": 10,
"offset": 0,
"params": {
"domain": "mybump2baby.com",
"company": null,
"type": null,
"offset": 0,
"seniority": null,
"department": null
}
}
}


thanks in advance for any help.

Hi,

Thank you. Do you have the URL to the Json array so I can do some trial and error? The results are not always the same as in theory :slight_smile:

Hi

you can get access to the API here https://hunter.io/ free account allows for a 100 request. :smile:

Thanks
Rob