Netmeds Collections
netmeds.collections.list
List the public Netmeds collections, the sets behind /collection/<slug>, so their products can be walked.
At a glance
- Endpoint ID
netmeds.collections.list- Price
- 1 credit per call; failed calls are free
- Runs for up to
- 45 seconds
Request
Send the endpoint ID as capability and its fields as input. Set UPSCRAPE_API_KEY to your key first.
curl --request POST \ --url https://data.upscrape.com/execute \ --header "Authorization: Bearer $UPSCRAPE_API_KEY" \ --header "Content-Type: application/json" \ --header "Prefer: wait=30" \ --data '{ "capability": "netmeds.collections.list", "input": { "page_size": 5 }}'
import jsonimport osimport requestspayload = json.loads(r'''{ "capability": "netmeds.collections.list", "input": { "page_size": 5 }}''')response = requests.post( "https://data.upscrape.com/execute", headers={ "Authorization": f"Bearer {os.environ['UPSCRAPE_API_KEY']}", "Content-Type": "application/json", "Prefer": "wait=30", }, json=payload,)response.raise_for_status()print(json.dumps(response.json(), indent=2))
const response = await fetch("https://data.upscrape.com/execute", { method: "POST", headers: { "Authorization": `Bearer ${process.env.UPSCRAPE_API_KEY}`, "Content-Type": "application/json", "Prefer": "wait=30", }, body: JSON.stringify({ "capability": "netmeds.collections.list", "input": { "page_size": 5 }}),});if (!response.ok) { throw new Error(`Upscrape request failed: ${response.status}`);}console.log(JSON.stringify(await response.json(), null, 2));
Input
| Field | Type | Required | What it does | Example |
|---|---|---|---|---|
limit |
integer | no | Alias for page_size (1 to 20). From 1 to 20. | |
page |
integer | no | 1-based page to read. One call reads only this page; pass next_page from the answer to continue. At least 1. Default: 1. |
|
page_size |
integer | no | Records in this one page, 1 to 20 (default 20). From 1 to 20. Default: 20. |
5 |
Response
A finished call answers with HTTP 200; the data is in results[0].data, and billing.credits_charged is what it cost. A call still running after the wait answers 202: see jobs and results.
This is results[0].data from a real run:
{ "has_more": true, "next_page": 2, "page": 1, "total_count": 2192, "items": [ { "name": "3 months NFM", "active": true, "description": "3 Months NFM codes.", "id": "69a54f26d9f30d0533296ee2", "image_url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9…", "published": true, "slug": "3-months-nfm", "type": "items", "url": "https://www.netmeds.com/collection/3-months-nfm" }, { "name": "6monthsNFM1", "active": true, "id": "695e290695708b990b85ab27", "image_url": "https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/production/applications/app_000000000000000000000001/media/collection/logo/w9…", "published": true, "slug": "6monthsnfm1", "type": "items", "url": "https://www.netmeds.com/collection/6monthsnfm1" } ]}
Fields
| Field | Type | Example |
|---|---|---|
items[].name |
string | 3 months NFM |
items[].active |
boolean | true |
items[].description |
string | 3 Months NFM codes. |
items[].id |
string | 69a54f26d9f30d0533296ee2 |
items[].image_url |
string | https://res.cloudinary.com/dwzm9bysq/image/upload/v1588857854/p… |
items[].published |
boolean | true |
items[].slug |
string | 3-months-nfm |
items[].type |
string | items |
items[].url |
string | https://www.netmeds.com/collection/3-months-nfm |
has_more |
boolean | true |
items |
array | 3 records |
next_page |
integer | 2 |
page |
integer | 1 |
total_count |
integer | 2192 |
If a call fails
A failed call costs nothing. The response carries an error.code you can branch on; Errors and retries lists every code and which ones to retry.
Other Netmeds endpoints
Something missing or unclear? Ask the team that builds the Netmeds endpoints.