# Consult Python get api url straight api url limit 1000 limit. how to use loop parameter next?

**URL:** <https://community.postman.com/t/consult-python-get-api-url-straight-api-url-limit-1000-limit-how-to-use-loop-parameter-next/27544>\
**Category:** Help Hub\
**Tags:** help\
**Created:** [September 7, 2021, 4:49am UTC](https://community.postman.com/t/consult-python-get-api-url-straight-api-url-limit-1000-limit-how-to-use-loop-parameter-next/27544 "2021-09-07T04:49:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spaceflight-special3](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@spaceflight-special3](https://community.postman.com/u/spaceflight-special3)\
**Post date:** [September 7, 2021, 4:49am UTC](https://community.postman.com/t/consult-python-get-api-url-straight-api-url-limit-1000-limit-how-to-use-loop-parameter-next/27544/1 "2021-09-07T04:49:28Z")

</div>

\*\*\* In the case of next is not a page number that is similar to the page \*\*\*

1. Shoot the URL, get data back 1000 at a time, which is data 1-1000 (api url is limited to 1000)

2. If you add Parameter next to the URL, you get 1000 but it starts at 1001 (data at 1001-2000 can loop 1000 as well)

3. Ask for an example method for loop parameter next (not page =1,2,3).

4. code python

```auto
import requests
import json

url = "https://api.xxx.com/"
api_key ="test"
user = "abc@test.co.th"

headers = {
"Content-Type": "application/json",
"Authorization": "apikey " + user + ":" + api_key
}

response = requests.get(url, verify=False, headers=headers)
data = response.json()
print(json.dumps(data, indent=4))

if (response.status_code == 200):
 print("status_code = " + str(response.status_code) + " The request was a success!")

elif (response.status_code == 404):
print("status_code = " + str(response.status_code) + " Result not found!")

```

1. The response code is quite large, I tried to show the code in the meta.

```auto
"meta": {
    "total_count": 2234,
    "offset": 0,
    "limit": 1000,
    "took": 138,
    "next": "/api/v2/intelligence/?q=%28%28status%3D%27active%27%29+and+%28confidence%3E%3D90%29+and+%28country%3D%27TH%27%29%29&search_after=1628780720222%2C57395475643&limit=1000"
   }

```
