Skip to content

Commit d71d238

Browse files
author
chriskh
committed
README updates
1 parent af97db2 commit d71d238

File tree

8 files changed

+209
-193
lines changed

8 files changed

+209
-193
lines changed

labs/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,25 @@ This directory contains hands-on resources to help you learn and master the **Se
2525

2626
---
2727

28+
## Quick Start Command
29+
30+
Open Terminal run the following:
31+
```bash
32+
cd selling-partner-api-samples/labs/server
33+
sh setup.sh
34+
```
35+
36+
Open a new terminal and run:
37+
```bash
38+
cd selling-partner-api-samples/labs
39+
jupyter lab .
40+
```
2841
## 📚 Quick Access Table
2942

3043
| Category | Folder | Description | Example |
3144
|--------------|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|--------------------------------------------------------|
3245
| 📖 Tutorials | [`tutorials/`](https://github.com/amzn/selling-partner-api-samples/tree/hands-on-labs/labs/tutorials) | Guided Jupyter notebooks focused on a single API workflow | Querying SKU economics with Data Kiosk |
3346
| 🏋️ Workshops | [`workshops/`](https://github.com/amzn/selling-partner-api-samples/tree/hands-on-labs/labs/workshops) | Multi-step challenges combining multiple APIs to solve real-world problems | Listing error diagnosis, Fulfillment workflows with MLI |
3447
| 🖥 Server | [`server/`](https://github.com/amzn/selling-partner-api-samples/tree/hands-on-labs/labs/server) | Mock server to run tutorials and workshops locally, and understand API flows | Listings Wizard, Data Kiosk, Shipping Guru |
48+
49+

labs/server/requirements.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ ipykernel
55
# SP-API SDK
66
amzn-sp-api
77

8-
# Data analysis & visualization
9-
pandas
10-
numpy
11-
matplotlib
12-
seaborn
13-
148
# Utils
159
requests
1610
python-dotenv
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# 📊 Data Kiosk Flow Tutorial
2+
3+
---
4+
5+
Welcome to the **Data Kiosk Flow Tutorial**!
6+
In this hands-on tutorial, you’ll learn how to work with the **Amazon Data Kiosk API** and understand the **end-to-end flow of querying, retrieving, and analyzing seller economics data**.
7+
8+
Unlike workshops, which are challenge-based, this tutorial is designed to **teach you the request/response flow** of the Data Kiosk API step by step.
9+
10+
---
11+
12+
#### ⚠️ Check the [🚀 How to Access](#-how-to-access) to learn more about deployment.
13+
14+
---
15+
16+
## 🧩 The Tutorial
17+
18+
This tutorial is organized into a single notebook:
19+
20+
#### data-kiosk-flow.ipynb
21+
22+
- **Goal**: Learn the flow of the Data Kiosk API from query creation to document retrieval.
23+
- **Steps you’ll cover**:
24+
1. Create a Data Kiosk query with `POST /dataKiosk/2023-11-15/queries`
25+
2. Check query status with `GET /dataKiosk/2023-11-15/queries/{queryId}`
26+
3. Retrieve all queries with `GET /dataKiosk/2023-11-15/queries`
27+
4. Fetch the final dataset with `GET /dataKiosk/2023-11-15/documents/{documentId}`
28+
- **Deliverable**: Understand how Data Kiosk integrates into SP-API flows and be able to extend queries for your own use cases.
29+
30+
---
31+
32+
## 🛠️ Tools You’ll Use
33+
34+
- SP-API SDK → pre-installed in the environment (Python).
35+
- Sample Payloads → included in the notebook.
36+
- Mock Endpoints → provided for safe experimentation (no live API calls required).
37+
- Step-by-Step Guidance → built directly into the notebook to help you follow the flow.
38+
39+
---
40+
41+
## 🎯 What You’ll Learn
42+
43+
By completing this tutorial, you’ll:
44+
- Understand the **full lifecycle** of a Data Kiosk query.
45+
- Learn how to **test queries locally** with the mock server.
46+
- Gain the foundation to integrate Data Kiosk into **custom seller analytics solutions**.
47+
48+
---
49+
50+
## 🚀 How to Access
51+
52+
### Quick Start - Amazon SP-API Mock Server
53+
54+
The fastest way to get started is using our automated setup scripts:
55+
56+
**macOS/Linux:**
57+
```bash
58+
cd selling-partner-api-samples/labs/server
59+
sh setup.sh
60+
```
61+
62+
**Windows:**
63+
64+
```bash
65+
setup.bat
66+
```
67+
68+
**The script will automatically:**
69+
70+
- Set up a virtual environment
71+
- Install all dependencies
72+
- Start the server at http://localhost:8000
73+
74+
You can run these notebooks on Amazon SageMaker → Notebook Instances
75+
**OR** run them locally in any Jupyter environment:
76+
77+
```bash
78+
cd labs/tutorials/data-kiosk
79+
python3 -m venv venv
80+
source venv/bin/activate
81+
pip install -r requirements.txt
82+
jupyter lab
83+
```

labs/tutorials/data-kiosk/data-kiosk-flow.ipynb

Lines changed: 23 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,13 @@
2828
},
2929
{
3030
"cell_type": "code",
31-
"execution_count": null,
3231
"id": "ef145f6d-ce8c-4c21-804e-254ca8190350",
33-
"metadata": {
34-
"ExecuteTime": {
35-
"end_time": "2025-09-05T08:45:48.456073Z",
36-
"start_time": "2025-09-05T08:45:40.864569Z"
37-
}
38-
},
39-
"outputs": [],
32+
"metadata": {},
4033
"source": [
4134
"pip install amzn-sp-api==1.2.0"
42-
]
35+
],
36+
"outputs": [],
37+
"execution_count": null
4338
},
4439
{
4540
"cell_type": "markdown",
@@ -88,15 +83,8 @@
8883
},
8984
{
9085
"cell_type": "code",
91-
"execution_count": null,
9286
"id": "4b7d9770-ccdc-4edd-a910-242916c578f7",
93-
"metadata": {
94-
"ExecuteTime": {
95-
"end_time": "2025-09-05T08:46:03.140419Z",
96-
"start_time": "2025-09-05T08:45:48.635393Z"
97-
}
98-
},
99-
"outputs": [],
87+
"metadata": {},
10088
"source": [
10189
"from spapi.models.datakiosk_v2023_11_15 import GetDocumentResponse, CreateQueryResponse, GetQueriesResponse, Query\n",
10290
"from spapi import SPAPIConfig, SPAPIClient, ApiException, QueriesApi, ProductPricingV2022Api, ListingsApi\n",
@@ -125,7 +113,9 @@
125113
"data_kiosk_api = QueriesApi(client.api_client)\n",
126114
"\n",
127115
"print(\"Connected to SP-API\")\n"
128-
]
116+
],
117+
"outputs": [],
118+
"execution_count": null
129119
},
130120
{
131121
"cell_type": "markdown",
@@ -149,10 +139,8 @@
149139
},
150140
{
151141
"cell_type": "code",
152-
"execution_count": null,
153142
"id": "c8d26053-3778-45bb-a3b1-3491e81526e1",
154143
"metadata": {},
155-
"outputs": [],
156144
"source": [
157145
"# This is a sample query - please update with your own query\n",
158146
"# Make sure to use backspaces with the quotation marks\n",
@@ -168,7 +156,9 @@
168156
"# Tell Amazon to start processing your query\n",
169157
"create_query_response = data_kiosk_api.create_query(body=graphql_query)\n",
170158
"print(\"✅ Query submitted! Response:\", create_query_response)"
171-
]
159+
],
160+
"outputs": [],
161+
"execution_count": null
172162
},
173163
{
174164
"cell_type": "markdown",
@@ -189,15 +179,15 @@
189179
},
190180
{
191181
"cell_type": "code",
192-
"execution_count": null,
193182
"id": "22d659b2-f89a-4c7e-bd5b-adf13ba85ccf",
194183
"metadata": {},
195-
"outputs": [],
196184
"source": [
197185
"# Tell Amazon to start processing your query\n",
198186
"create_query_response = data_kiosk_api.create_query(body=graphql_query)\n",
199187
"print(\"✅ Query submitted! Response:\", create_query_response)"
200-
]
188+
],
189+
"outputs": [],
190+
"execution_count": null
201191
},
202192
{
203193
"cell_type": "markdown",
@@ -224,15 +214,15 @@
224214
},
225215
{
226216
"cell_type": "code",
227-
"execution_count": null,
228217
"id": "0857ee42-ce36-4252-8a11-2ca395f1b1de",
229218
"metadata": {},
230-
"outputs": [],
231219
"source": [
232220
"# Check the status of your query\n",
233221
"get_query_response = data_kiosk_api.get_query(query_id=create_query_response.query_id)\n",
234222
"print(\"⏱️ Query status:\", get_query_response)"
235-
]
223+
],
224+
"outputs": [],
225+
"execution_count": null
236226
},
237227
{
238228
"cell_type": "markdown",
@@ -254,15 +244,15 @@
254244
},
255245
{
256246
"cell_type": "code",
257-
"execution_count": null,
258247
"id": "02bceeee-e931-4ccc-b01f-d3368fe6d335",
259248
"metadata": {},
260-
"outputs": [],
261249
"source": [
262250
"# Now let's get the actual data!\n",
263251
"get_document = data_kiosk_api.get_document(document_id=get_query_response.data_document_id)\n",
264252
"print(\"📊 Here's your data:\", get_document)"
265-
]
253+
],
254+
"outputs": [],
255+
"execution_count": null
266256
},
267257
{
268258
"cell_type": "markdown",
@@ -293,19 +283,9 @@
293283
]
294284
},
295285
{
296-
"metadata": {},
297286
"cell_type": "code",
298-
"outputs": [],
299-
"execution_count": null,
300-
"source": "pip install pandas",
301-
"id": "6eb9f3ee0e837b80"
302-
},
303-
{
304-
"cell_type": "code",
305-
"execution_count": null,
306287
"id": "dc0721a2-e9ab-403f-b87b-4ef0883e35a9",
307288
"metadata": {},
308-
"outputs": [],
309289
"source": [
310290
"import ast\n",
311291
"import pandas as pd\n",
@@ -351,7 +331,9 @@
351331
"\n",
352332
"plt.tight_layout()\n",
353333
"plt.show()\n"
354-
]
334+
],
335+
"outputs": [],
336+
"execution_count": null
355337
},
356338
{
357339
"cell_type": "markdown",

labs/workshops/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ cd selling-partner-api-samples/labs/server
2323
sh setup.sh
2424
```
2525

26-
Or download and run:
27-
```bash
28-
curl -O https://raw.githubusercontent.com/amzn/sp-api-sample-solutions/main/labs/server/setup.sh
29-
chmod +x setup.sh
30-
./setup.sh
31-
```
32-
3326
**Windows:**
3427
```cmd
3528
setup.bat

0 commit comments

Comments
 (0)