script to get api data