Autocomplete
curl --request GET \
--url https://scrapebadger.com/v1/walmart/autocomplete \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/walmart/autocomplete"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/walmart/autocomplete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/walmart/autocomplete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/walmart/autocomplete"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/walmart/autocomplete")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/walmart/autocomplete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"query": "<string>",
"result_count": 123,
"suggestions": [
{
"query": "<string>",
"type": "<string>",
"image_url": "<string>",
"url": "<string>",
"department_id": "<string>",
"department_name": "<string>"
}
]
}Search
Autocomplete
Walmart search-box suggestions for a partial term, with the department each one belongs to.
GET
/
v1
/
walmart
/
autocomplete
Autocomplete
curl --request GET \
--url https://scrapebadger.com/v1/walmart/autocomplete \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/walmart/autocomplete"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/walmart/autocomplete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/walmart/autocomplete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/walmart/autocomplete"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/walmart/autocomplete")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/walmart/autocomplete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"query": "<string>",
"result_count": 123,
"suggestions": [
{
"query": "<string>",
"type": "<string>",
"image_url": "<string>",
"url": "<string>",
"department_id": "<string>",
"department_name": "<string>"
}
]
}Expand a partial search term into Walmart’s own search-box suggestions, each
tagged with the department it belongs to. Backed by Walmart’s typeahead
service — the cheapest call in this API.
Credits: 1
Authorization
string
required
Your ScrapeBadger API key.
Query Parameters
string
required
Partial search term, e.g.
lapt.Response
string
Echo of the requested query.
integer
Number of suggestions.
Suggestion[]
Example
curl "https://scrapebadger.com/v1/walmart/autocomplete?query=lapt" \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch(
"https://scrapebadger.com/v1/walmart/autocomplete?" +
new URLSearchParams({ query: "lapt" }),
{ headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY } },
);
const data = await res.json();
import requests
res = requests.get(
"https://scrapebadger.com/v1/walmart/autocomplete",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"query": "lapt"},
)
data = res.json()
Response
{
"query": "lapt",
"result_count": 8,
"suggestions": [
{
"query": "laptop",
"type": "QUERY",
"image_url": "https://i5.walmartimages.com/asr/82b98986-afdd-40c3-a2d5-b0355110c65d.jpeg",
"url": "https://www.walmart.com/search?query=laptop&typeahead=laptop",
"department_id": "3944",
"department_name": "Electronics"
},
{
"query": "laptop computers under $200",
"type": "QUERY",
"image_url": "https://i5.walmartimages.com/asr/043886ec-7727-46d0-aa46-432fb2e614b3.jpeg",
"url": "https://www.walmart.com/search?query=laptop%20computers%20under%20%24200&typeahead=laptop",
"department_id": "3944",
"department_name": "Electronics"
},
{
"query": "laptop resold",
"type": "QUERY",
"image_url": "https://i5.walmartimages.com/dfw/63fd9f59-d78b/glass_icon.png",
"url": "https://www.walmart.com/search?query=laptop%20resold&typeahead=laptop",
"department_id": null,
"department_name": null
}
]
}
Because
/search hits a hard
page-10 wall, fanning one term out into several suggested queries and merging
the results on us_item_id buys wider coverage than paging deeper — at 1
credit per expansion.⌘I

