cancel
Showing results for 
Search instead for 
Did you mean: 

I need to retrieve data from a public API

TheDev
New Contributor

I am new to snaplogic and I have an exercise where I need to retrieve data from randomuser.me/api/. I have to filter the data based on age and a few more things. Can someone tell me the basics and what can I use to filter the data? So far I get the data with the snap "REST Get" but I haven't found how to filter it. It seems like I have to retrieve this data 100 times because with every request the data will be different.

1 ACCEPTED SOLUTION

koryknick
Employee
Employee

@TheDev - I just did a quick search on the API you list above and it appears you can get multiple results in a single call:

https://randomuser.me/api/?results=100

I recommend you use a JSON Splitter to pull individual records out of the returned results array, then a Filter snap to reduce the data to your desired results.  If you want to transform the records from there, use the Mapper snap.

If you are looking for a way to kick start into SnapLogic, register for an upcoming training workshop!

Hope this helps!

 

View solution in original post

2 REPLIES 2

koryknick
Employee
Employee

@TheDev - I just did a quick search on the API you list above and it appears you can get multiple results in a single call:

https://randomuser.me/api/?results=100

I recommend you use a JSON Splitter to pull individual records out of the returned results array, then a Filter snap to reduce the data to your desired results.  If you want to transform the records from there, use the Mapper snap.

If you are looking for a way to kick start into SnapLogic, register for an upcoming training workshop!

Hope this helps!

 

Thank you, I solved it before the reply and I came to say it's done. I didn't know much about APIs and now I understand that I should've gone through the documentation first to understand how I can handle the data. I solved it by adding a query parameter like in the picture.

 

TheDev_0-1706312866686.png

Also, thank you for suggesting the training workshop. Have a good weekend!