|
28 | 28 | }, |
29 | 29 | { |
30 | 30 | "cell_type": "code", |
31 | | - "execution_count": null, |
32 | 31 | "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": {}, |
40 | 33 | "source": [ |
41 | 34 | "pip install amzn-sp-api==1.2.0" |
42 | | - ] |
| 35 | + ], |
| 36 | + "outputs": [], |
| 37 | + "execution_count": null |
43 | 38 | }, |
44 | 39 | { |
45 | 40 | "cell_type": "markdown", |
|
88 | 83 | }, |
89 | 84 | { |
90 | 85 | "cell_type": "code", |
91 | | - "execution_count": null, |
92 | 86 | "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": {}, |
100 | 88 | "source": [ |
101 | 89 | "from spapi.models.datakiosk_v2023_11_15 import GetDocumentResponse, CreateQueryResponse, GetQueriesResponse, Query\n", |
102 | 90 | "from spapi import SPAPIConfig, SPAPIClient, ApiException, QueriesApi, ProductPricingV2022Api, ListingsApi\n", |
|
125 | 113 | "data_kiosk_api = QueriesApi(client.api_client)\n", |
126 | 114 | "\n", |
127 | 115 | "print(\"Connected to SP-API\")\n" |
128 | | - ] |
| 116 | + ], |
| 117 | + "outputs": [], |
| 118 | + "execution_count": null |
129 | 119 | }, |
130 | 120 | { |
131 | 121 | "cell_type": "markdown", |
|
149 | 139 | }, |
150 | 140 | { |
151 | 141 | "cell_type": "code", |
152 | | - "execution_count": null, |
153 | 142 | "id": "c8d26053-3778-45bb-a3b1-3491e81526e1", |
154 | 143 | "metadata": {}, |
155 | | - "outputs": [], |
156 | 144 | "source": [ |
157 | 145 | "# This is a sample query - please update with your own query\n", |
158 | 146 | "# Make sure to use backspaces with the quotation marks\n", |
|
168 | 156 | "# Tell Amazon to start processing your query\n", |
169 | 157 | "create_query_response = data_kiosk_api.create_query(body=graphql_query)\n", |
170 | 158 | "print(\"✅ Query submitted! Response:\", create_query_response)" |
171 | | - ] |
| 159 | + ], |
| 160 | + "outputs": [], |
| 161 | + "execution_count": null |
172 | 162 | }, |
173 | 163 | { |
174 | 164 | "cell_type": "markdown", |
|
189 | 179 | }, |
190 | 180 | { |
191 | 181 | "cell_type": "code", |
192 | | - "execution_count": null, |
193 | 182 | "id": "22d659b2-f89a-4c7e-bd5b-adf13ba85ccf", |
194 | 183 | "metadata": {}, |
195 | | - "outputs": [], |
196 | 184 | "source": [ |
197 | 185 | "# Tell Amazon to start processing your query\n", |
198 | 186 | "create_query_response = data_kiosk_api.create_query(body=graphql_query)\n", |
199 | 187 | "print(\"✅ Query submitted! Response:\", create_query_response)" |
200 | | - ] |
| 188 | + ], |
| 189 | + "outputs": [], |
| 190 | + "execution_count": null |
201 | 191 | }, |
202 | 192 | { |
203 | 193 | "cell_type": "markdown", |
|
224 | 214 | }, |
225 | 215 | { |
226 | 216 | "cell_type": "code", |
227 | | - "execution_count": null, |
228 | 217 | "id": "0857ee42-ce36-4252-8a11-2ca395f1b1de", |
229 | 218 | "metadata": {}, |
230 | | - "outputs": [], |
231 | 219 | "source": [ |
232 | 220 | "# Check the status of your query\n", |
233 | 221 | "get_query_response = data_kiosk_api.get_query(query_id=create_query_response.query_id)\n", |
234 | 222 | "print(\"⏱️ Query status:\", get_query_response)" |
235 | | - ] |
| 223 | + ], |
| 224 | + "outputs": [], |
| 225 | + "execution_count": null |
236 | 226 | }, |
237 | 227 | { |
238 | 228 | "cell_type": "markdown", |
|
254 | 244 | }, |
255 | 245 | { |
256 | 246 | "cell_type": "code", |
257 | | - "execution_count": null, |
258 | 247 | "id": "02bceeee-e931-4ccc-b01f-d3368fe6d335", |
259 | 248 | "metadata": {}, |
260 | | - "outputs": [], |
261 | 249 | "source": [ |
262 | 250 | "# Now let's get the actual data!\n", |
263 | 251 | "get_document = data_kiosk_api.get_document(document_id=get_query_response.data_document_id)\n", |
264 | 252 | "print(\"📊 Here's your data:\", get_document)" |
265 | | - ] |
| 253 | + ], |
| 254 | + "outputs": [], |
| 255 | + "execution_count": null |
266 | 256 | }, |
267 | 257 | { |
268 | 258 | "cell_type": "markdown", |
|
293 | 283 | ] |
294 | 284 | }, |
295 | 285 | { |
296 | | - "metadata": {}, |
297 | 286 | "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, |
306 | 287 | "id": "dc0721a2-e9ab-403f-b87b-4ef0883e35a9", |
307 | 288 | "metadata": {}, |
308 | | - "outputs": [], |
309 | 289 | "source": [ |
310 | 290 | "import ast\n", |
311 | 291 | "import pandas as pd\n", |
|
351 | 331 | "\n", |
352 | 332 | "plt.tight_layout()\n", |
353 | 333 | "plt.show()\n" |
354 | | - ] |
| 334 | + ], |
| 335 | + "outputs": [], |
| 336 | + "execution_count": null |
355 | 337 | }, |
356 | 338 | { |
357 | 339 | "cell_type": "markdown", |
|
0 commit comments