Snapchat Search
snapchat.search
Search
At a glance
- Endpoint ID
snapchat.search- Price
- 1 credit per call; failed calls are free
- Runs for up to
- 30 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": "snapchat.search", "input": { "query": "nasa" }}'
import jsonimport osimport requestspayload = json.loads(r'''{ "capability": "snapchat.search", "input": { "query": "nasa" }}''')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": "snapchat.search", "input": { "query": "nasa" }}),});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 |
|---|---|---|---|---|
query |
string | yes | Term as typed into Snapchat's search box, for example nasa or face filter. | nasa |
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:
{ "total": 16, "url": "https://www.snapchat.com/explore/nasa", "sections": [ { "kind": "profiles", "items": [ { "name": "NASA", "username": "nasa", "description": "Explore the universe and discover our home planet with official NASA snaps.", "followers_label": "750k", "id": "cb983b26-c537-474b-9699-065309205ea2", "kind": "profiles", "url": "https://www.snapchat.com/@nasa" }, { "name": "βππππππππππππβ", "username": "nasalishious", "followers_label": "20k", "id": "05e038c1-dbc3-4e9b-9f9a-da359586a6de", "image_url": "https://cf-st.sc-cdn.net/3d/render/35835789-234169840_44-s5-v1.webp?ua=2", "kind": "profiles", "url": "https://www.snapchat.com/@nasalishious" } ] }, { "kind": "episodes", "items": [ { "title": "Did a NASA Hacker Really Find Proof of UFOs? Β· 17w ago", "id": "3137396772890624", "image_url": "https://cf-st.sc-cdn.net/d/OZai6w35KJEuGF4ynxO5n.310?uc=5", "kind": "episode", "url": "https://www.snapchat.com/p/0fd723dc-b081-4dce-8569-af420cf952c5/3137396772890624", "publisher": { "name": "Kendall Rae", "url": "https://www.snapchat.com/p/0fd723dc-b081-4dce-8569-af420cf952c5" } }, { "title": "La NASA rΓ©vΓ¨le le son de la naissance des Γ©toiles π Β· 7d ago", "id": "63182112794624", "image_url": "https://cf-st.sc-cdn.net/d/Fc3n8f2KDQNhkFZycDMEK.310?uc=5", "kind": "episode", "url": "https://www.snapchat.com/p/c62af329-38ab-4878-a503-a33fcc3182c0/63182112794624", "publisher": { "name": "Brut Nature", "url": "https://www.snapchat.com/p/c62af329-38ab-4878-a503-a33fcc3182c0" } } ] } ]}
Fields
| Field | Type | Example |
|---|---|---|
sections[].items[].name |
string | NASA |
sections[].items[].username |
string | nasa |
sections[].items |
array | 3 records |
sections[].items[].description |
string | Explore the universe and discover our home planet with official⦠|
sections[].items[].followers_label |
string | 750k |
sections[].items[].id |
string | cb983b26-c537-474b-9699-065309205ea2 |
sections[].items[].kind |
string | profiles |
sections[].items[].url |
string | https://www.snapchat.com/@nasa |
sections[].kind |
string | profiles |
sections |
array | 3 records |
total |
integer | 16 |
url |
string | https://www.snapchat.com/explore/nasa |
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 Snapchat endpoints
Something missing or unclear? Ask the team that builds the Snapchat endpoints.