Nintendo Switch availability monitor
Nintendo Switch is a very popular game console and people often find it out of stock in online stores. In this tutorial, we'll use CronDog to monitor Nintendo Switch availability on Target.com, and receive an email notification when it is in stock.
1. Set up HTTP request
After logging into the CronDog dashboard, click New task on the All Tasks page. The task creation form opens with Request, Schedule, and Notifications sections.
Under the Request and Schedule sections, provide the following values:
| Field | Value | Notes |
|---|---|---|
| Task Name | Nintendo Switch monitor - Target | The name of the task |
| URL | https://redsky.target.com/v3/pdp/tcin/77464002?excludes=taxonomy&key=eb2551e4accc14f38cc42d32fbc2b2ea | Target.com API that returns Nintendo Switch availability |
| Request Method | GET | |
| Request Headers | None | No headers are needed |
| Schedule | Every 1 day | The task will run once every day |
This tells the task to issue a GET request to the Target.com API endpoint once every day for Nintendo Switch availability information.
2. Create email notification
The Target API returns the following data in JSON format, which you can check by visiting the Target Nintendo Switch website and inspecting your browser's network traffic in the developer console:
Let us set up a notification condition around the API response's online availability property, so we can get notified when Switch is in stock. Under the Notifications section, click the Add button next to the Email label:
The Add email notification dialog opens.
Then provide the following values in the dialog:
| Field | Value | Notes |
|---|---|---|
| Source | Response Body (JSON) | Parse the API response as JSON payload |
| Property | product.available_to_promise_network.online_available_to_promise_quantity | The property path for online availability information in JSON response |
| Comparison | greater than (number) | |
| Value | 0 | This tells CronDog that whenever the property is greater than 0, an email notification will be sent |
| To | Your email address | |
| Subject | Switch is available! | The email subject |
| Message | Nintendo Switch is available! Go to https://www.target.com/p/nintendo-switch-with-gray-joy-con/-/A-77464002 and order one! | The email body |
This tells CronDog to send an email notification whenever the Target API response body's online_available_to_promise_quantity property value is greater than 0.
Click Save. The new email notification appears under the Notifications section.
3. Save task
Click Create at the bottom of the task creation page.
After the task is created, CronDog opens the task detail page with the status set to Active.
4. Test task
To make sure your task settings such as URL and notification rules are properly configured, test your task at least once by clicking Run now at the top of the task page. Run now triggers the HTTP request right away and evaluates all configured notification conditions.
Let us pick a stock quantity that is lower than the current value for testing purposes, say -1. In the Settings tab, go to Notifications and click the pencil icon in the email notification's Actions column.
Change the value from 0 to -1, then click Save. Now the task should be able to send an email notification when Switch quantity is greater than -1. Click Run now at the top of the page. The task page switches to the History tab, where you can check the task status. Within a few seconds, you should see the execution status turn into SUCCESS.
At this point, you should receive an email triggered by the task.
If things didn't work as expected, this could happen due to a misconfigured notification condition such as an invalid JSON property path, or due to a temporary network connectivity issue. Check the errors section in the execution detail for a hint.
Once everything is working as expected, you can revert the email notification condition by changing the value back to 0, and then click Save.
5. Sit and wait
Congratulations! You can now sit back and wait for the CronDog email notification whenever Nintendo Switch is in stock on Target.com!
