Walmart Autocomplete API
This API can be used for scraping search suggestions from Walmart. All you need is a search term.
You have to send a GET request to https://api.scrapingdog.com/walmart/autocomplete with the following parameters.
Parameters
Scrapingdog Parameters
Parameter
Description
api_key
required
Your personal API key. Available on your dashboard Type: String
Search Query
Parameter
Description
query
This is the Walmart search query. Type: String
API Example
curl "https://api.scrapingdog.com/walmart/autocomplete?api_key=5eaa61a6e562fc52fe763tr516e4653&query=football"import requests
url = "https://api.scrapingdog.com/walmart/autocomplete"
params = {
"api_key": "5eaa61a6e562fc52fe763tr516e4653",
"query": "football"
}
response = requests.get(url, params=params)
if response.status_code == 200:
data = response.json()
print(data)
else:
print(f"Request failed with status code {response.status_code}")
const axios = require('axios');
const url = 'https://api.scrapingdog.com/walmart/autocomplete';
const params = {
api_key: '5eaa61a6e562fc52fe763tr516e4653',
url: 'football'
};
axios
.get(url, { params })
.then((response) => {
if (response.status === 200) {
const data = response.data;
console.log(data);
} else {
console.log(`Request failed with status code ${response.status}`);
}
})
.catch((error) => {
console.error('Request failed with an error:', error);
});
<?php
$apiUrl = 'https://api.scrapingdog.com/walmart/autocomplete';
$apiKey = '5eaa61a6e562fc52fe763tr516e4653';
$query= 'football';
$queryString = http_build_query([
'api_key' => $apiKey,
'query' => $query
]);
$fullUrl = $apiUrl . '?' . $queryString;
$ch = curl_init($fullUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode == 200) {
$data = json_decode($response, true);
print_r($data);
} else {
echo "Request failed with status code $httpCode\n";
}
curl_close($ch);
?>
require 'net/http'
require 'json'
api_url = 'https://api.scrapingdog.com/walmart/autocomplete'
api_key = '5eaa61a6e562fc52fe763tr516e4653'
query = 'football'
params = {
'api_key' => api_key,
'query' => query
}
uri = URI(api_url)
uri.query = URI.encode_www_form(params)
response = Net::HTTP.get_response(uri)
if response.is_a?(Net::HTTPSuccess)
data = JSON.parse(response.body)
puts data
else
puts "Request failed with status code #{response.code}"
end
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Main {
public static void main(String[] args) {
String apiURL = "https://api.scrapingdog.com/walmart/autocomplete";
String apiKey = "5eaa61a6e562fc52fe763tr516e4653";
String query = "football";
try {
// Create the URL with query parameters
URL url = new URL(apiURL + "?api_key=" + apiKey + "&query=" + query);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// Set the request method to GET
connection.setRequestMethod("GET");
// Get the response code
int responseCode = connection.getResponseCode();
if (responseCode == 200) {
// Read the response data
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
StringBuilder response = new StringBuilder();
while ((line = reader.readLine()) != null) {
response.append(line);
}
reader.close();
// Print the response data
System.out.println(response.toString());
} else {
System.out.println("Request failed with response code: " + responseCode);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
API Response
{
"queries": [
{
"type": "QUERY",
"displayName": "football cards",
"url": "query=football%20cards&typeahead=football",
"analyticsFm": 5
},
{
"type": "QUERY",
"displayName": "football gloves",
"url": "query=football%20gloves&typeahead=football"
},
{
"type": "QUERY",
"displayName": "football cleats",
"url": "query=football%20cleats&typeahead=football"
},
{
"type": "QUERY",
"displayName": "football",
"url": "query=football&typeahead=football"
},
{
"type": "QUERY",
"displayName": "football mouthpiece",
"url": "query=football%20mouthpiece&typeahead=football"
},
{
"type": "QUERY",
"displayName": "football mouthguard",
"url": "query=football%20mouthguard&typeahead=football"
},
{
"type": "QUERY",
"displayName": "football party supplies",
"url": "query=football%20party%20supplies&typeahead=football"
},
{
"type": "QUERY",
"displayName": "football accessories",
"url": "query=football%20accessories&typeahead=football"
}
],
"fns": {
"navigationModules": [
{
"type": "facet",
"displayName": "Football Selections",
"displayQuery": "Football",
"showImages": true,
"values": [
{
"displayName": "Footballs",
"url": "browse/sports-outdoors/footballs/4125_4161_434036_1075724?povid=SF_pills_434036_Footballs_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-ca70/k2-_e2688036-3556-48de-b516-6ec4d9cd4091.v1.jpg"
},
{
"displayName": "Football gloves",
"url": "browse/sports-outdoors/football-gloves/4125_4161_434036_9912999?povid=SF_pills_434036_Footballgloves_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-e06b/k2-_d063e090-8cc4-4180-a9d6-12fcefa758e4.v1.jpg"
},
{
"displayName": "Football cleats",
"url": "browse/sports-outdoors/football-cleats/4125_4161_434036_7148421?povid=SF_pills_434036_Footballcleats_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-a15e/k2-_2c3a0d2c-d63e-4431-8c2f-ba0155f4eecd.v1.jpg"
},
{
"displayName": "Football helmets",
"url": "browse/sports-outdoors/football-helmets/4125_4161_434036_4440157?povid=SF_pills_434036_Footballhelmets_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-8940/k2-_d4be9a92-34fd-4cbc-9755-6c6de78f0b98.v1.jpg"
},
{
"displayName": "Football mouth guards",
"url": "browse/sports-outdoors/football-mouth-guards/4125_4161_434036_1390959?povid=SF_pills_434036_Footballmouthguards_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-fb94/k2-_bfb21629-465c-4a8d-9fe2-cd660efb1766.v1.jpg"
},
{
"displayName": "Football protective gear",
"url": "browse/sports-outdoors/football-pads-protective-gear/4125_4161_434036_9000704?povid=SF_pills_434036_Footballpads&protectivegear_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-72ce/k2-_d73ea977-2db6-4f2a-a313-62fa3f623672.v1.jpg"
},
{
"displayName": "Flag football",
"url": "browse/sports-outdoors/flag-football-flags/4125_4161_434036_7943860?povid=SF_pills_434036_Flagfootball_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-4202/k2-_83243adb-e142-4ab7-a281-f01253f76bda.v1.jpg"
},
{
"displayName": "Football accessories",
"url": "browse/sports-outdoors/football-accessories/4125_4161_434036_6996512?povid=SF_pills_434036_Footballaccessories_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-ba1d/k2-_f331ad23-dc9d-4a28-8d05-3ebcfca19c08.v1.jpg"
},
{
"displayName": "Football Training Equipment ",
"url": "browse/sports-outdoors/football-training-equipment/4125_4161_434036_4599934",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-e86a/k2-_34db5066-d67d-4402-ac26-43d0c45d5891.v1.jpg"
},
{
"displayName": "Football chin straps",
"url": "browse/sports-outdoors/football-chin-straps/4125_4161_434036_7247540?povid=SF_pills_434036_Footballchinstraps_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-889e/k2-_9c84fbf8-02fb-4895-a508-da97b5d2e4a5.v1.jpg"
},
{
"displayName": "Youth football",
"url": "browse/sports-outdoors/youth-football/4125_4161_434036_6940401?povid=SF_pills_434036_Youthfootball_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-e370/k2-_fe860035-dccf-4590-b4f3-7f78388de719.v1.jpg"
},
{
"displayName": "Soccer",
"url": "browse/sports-outdoors/soccer/4125_4161_432196?povid=SF_pills_434036_Soccer_08_02_23",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-8c18/k2-_d9b58791-fe0b-440c-b9fa-4142c9fad6d0.v1.jpg"
},
{
"displayName": "Shop all sports",
"url": "shop/deals/sports-and-outdoors?povid=SF_pills_434036_All_Sports_08_01_24",
"image": "https://i5.walmartimages.com/dfw/4ff9c6c9-7f11/k2-_183470b1-6718-4f9e-9b52-72a0263d2bd2.v1.webp"
}
]
}
],
"navModuleAnalytics": {
"fm": 5
}
}
}Last updated