Please ignore the advice you are being given by @Shivraj Gudas, as it's just more of the same generic cut'n'paste nonsense that has been swirling around on this topic for more than six months.
Go to the Jira section of the Atlassian public Community Forum and do a general search on the topic of the new JQL Search endpoints. You'll find the topic has been discussed many, many, MANY times there over the past six months, and there is detailed descriptions and links to extensive documentation on how to use the new endpoints and how their pagination mechanism is different to their predecessors, which have now all been deprecated.