Forum Discussion

jaikumar1's avatar
jaikumar1
Mentor
6 years ago

Any limitation for api results

Hi,

When i use the recent solution API and i'm seeing the API returns very minimal amount of results. For example, the API /solutions/recent returns 25 records by default and when we add the some filter criteria(?date_start=2018-10-18&date_end=2019-02-19&page_size=1000) and it returns only 100 records and not more than that. 

So i'm just checking with you all, any other configuration is available in studio? and how to get the exact  results using the API.

 

  • jaikumar1, You can fetch maximum of 1000 records from the API. There is limit in API to give maximum results to  page_size: parameter must be less than or equal to 1,000. 

    If you want to call data more than that you can use "page" parameter for next set of records.

    Your API would be like below "?date_start=2018-10-18&date_end=2019-02-19&page_size=999&page=1" for next set of records after 999 you have to pass "page=2".

    In your case might be results you are getting 100 is due to the particular date range selected.

    Also I would recommend to showing no more than 25 threads per page. Increasing the page_size may cause performances issue.

     

     

    • jaikumar1's avatar
      jaikumar1
      Mentor

      Thank you VarunGrazitti  and Parshant 

      I have checked the count API (/solutions/count) which returns around 4000 records. But when i use the recent solution API(/solutions/recent) it's returning the only 100 records even i put the filters date_start and page_size in the recent post and it returning the same 100 records. 

      i also applied the filter with the combination of (?date_start=2017-10-18&date_end=2019-02-19&page_size=90&page=2 ) second page and it returns only 10 records. So i'm not sure, the Lithium may have restriction and not allow the API to display all the records. 

      Actually, we just planning to build the Grid for the recent solution with pagination. So we looked at the available API to build the grid and we plan to display 20 records per page.

       

       

      • Parshant's avatar
        Parshant
        Boss

        jaikumar1,

        If you are facing this issue on V1 API do also cross check with V2 API in your community API Browser using below API.

        SELECT * FROM messages WHERE is_solution = true

        You can also pass date filter parameter in API, Here is all the documentation for this.

  • jaikumar1 - By default, you get 25 results in the API. If you pass the page size, you get the same number. However, the max results you can get in a single query is 1000. Instead, you can first get the count and then pass that number to page size, make sure the logics are there. Make sure the count is handled properly.

     

    I hope this helps.