Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Prido's avatar
Level 2

Error while fetching data from API

I am fetching data from api recursively getting 100 items per request as the data is paginated by default from the API. I then save this data to the db again and again untill all records are finished. When the fetching reach page number 25 that means 2500 records it throw an error " could not resolve host name for "https://api.com"" Or sometimes " no data received from server" Am stuck here. Total records are like 40 000

0 likes
2 replies
sarmenhb's avatar

if the message is coming from the api then that would be the servers problem. try playing with the api with a gui app retrieving a few records here and there and see if you hit the same results.

jlrdw's avatar

I wonder if you are incurring a Timeout on the server.

Please or to participate in this conversation.