Welcome to the Google Apps Scripts for Jungle Scout's API repository! This project houses various Google Apps Scripts designed to facilitate interactions with the Jungle Scout API directly from Google Sheets. Whether you're looking to automate data retrieval, streamline your workflow, or simply explore the capabilities of Jungle Scout's API, these scripts serve as a robust starting point.
See the Jungle Scout API Documentation and the Jungle Scout Postman Collection for more information about the Jungle Scout API.
Each of the use cases is separated into its own folder. Those use cases would be associated with a separate Google spreadsheet.
Before diving into these scripts, ensure you have the following:
- Jungle Scout Subscription: You'll need a subscription to either the Jungle Scout Suite or Professional (Pro) plans to access the Jungle Scout API. Once you've used your trial credits, continuing to access the Jungle Scout API requires an API subscription plan.
- A Google Spreadsheet: For each script, you'll need a Google Spreadsheet relevant to your use case. Important: you'll need the Sheet ID from the spreadsheet's URL for the scripts to function correctly. You can copy the Organic Impressions Estimator template as a starting point.
- A Jungle Scout API Key: Authentication with the Jungle Scout API requires an API key. This includes the API key itself and the name associated with your API key. These details are crucial for setting up the environment variables within your Google Apps Script project.
- Open your Google Spreadsheet.
- Navigate to
Extensions > Apps Script
. - In the Apps Script, click on
Project Settings > Script properties
. - Add the following script properties with their respective values:
API_KEY
: Your Jungle Scout API key.API_KEY_NAME
: The name associated with your Jungle Scout API key.TARGET_SPREADSHEET_ID
: The ID of your spreadsheet.
- Download the script files from the appropriate folder within the repository.
- Open the Google Apps Script editor for your spreadsheet (as described above).
- For each file you want to use:
- Click on
Files > + > Script
. - Name the file accordingly.
- Copy and paste the content of the downloaded file into the editor.
- Click on
- Save your changes.
Clasp is a tool that allows you to upload your scripts to Google Apps Script projects from the command line. This method is more convenient, allowing you to edit files locally, but it is a bit more advanced.
When working with multiple folders in this repository, it's essential to treat each folder as a separate Google Apps Script project. This means you'll use clasp
to create and manage a distinct project for the scripts within each folder.
- Install
clasp
by runningnpm install -g @google/clasp
in your terminal. - Login to
clasp
withclasp login
. - Enable the Google Apps Script API for your Google account by visiting Google Apps Script API and enabling the setting.
- For each use case folder you intend to deploy:
- Navigate to the specific folder you've cloned or downloaded from this repository.
- Run
clasp create --type sheets --title "Your Use Case Title"
inside the folder. This command creates a new Google Apps Script project associated with that folder's scripts. - Use
clasp push
to upload the scripts to your new Google Apps Script project.
By creating a separate "clasp project" for each folder, you ensure that each set of scripts is organized and managed as its own project within Google Apps Script. This approach is particularly useful for maintaining project-specific dependencies, settings, and versions.
For comprehensive guidance on using clasp
, consult the clasp
documentation.
These scripts are designed to interact with the Jungle Scout API and populate Google Sheets with the data you need. Here's how to get started with a basic script:
- Ensure you have met all the prerequisites.
- Copy the appropriate template file.
- Follow the installation steps to set up your script.
- Customize the script parameters to suit your specific needs, such as adjusting API endpoints or data processing functions.
- Run the script and watch as your Google Sheet gets populated with data from the Jungle Scout API.
Remember, these scripts make live calls to the Jungle Scout API, which will count against your monthly limit. Be careful when testing new functionality.
Google Apps Script provides a powerful feature called Triggers which allows you to run functions automatically based on certain conditions, including time intervals. This is especially useful if you want to automate repetitive tasks like pulling ranking data from Jungle Scout and saving it to your Google Sheet on a daily basis.
Follow these steps to set up a recurring job for your script:
- Open the Apps Script Project: Navigate to your Google Spreadsheet, go to Extensions > Apps Script to open the project containing the script you wish to automate.
- Access Triggers: In the Apps Script editor, find and click on the clock icon in the left sidebar to open the Triggers page.
- Add a Trigger: Click on the
+ Add Trigger
button at the bottom right corner of the page. - Configure the Trigger:
- Choose which function to run: Select the function you want to automate from the dropdown menu.
- Choose which deployment should run: Typically, you'll select
Head
for scripts still in development. - Select event source: Choose
Time-driven
to set up a recurring trigger. - Select type of time based trigger: Pick the interval that suits your need. For daily updates, you'll select
Day timer
and then specify the time of day you want the script to run.
- Save: After configuring your trigger, click
Save
.
Now, your selected function will automatically run at the intervals you specified, pulling data into your Google Sheet without any manual intervention needed.
- API Call Limits: Remember that automated calls to the Jungle Scout API will count against your monthly limit. Plan your triggers accordingly to avoid unexpected quota exceedances.
- Testing: It's a good idea to manually test your script to ensure it behaves as expected before automating it with triggers.
- Monitoring: You can monitor the execution of scheduled functions and check for any errors by going to the Executions tab in the Apps Script editor.
By leveraging time-based triggers, you can automate your data collection process, ensuring your Google Sheet always has the latest information from Jungle Scout without needing to manually run scripts.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. More details on how to contribute will be provided soon.
This project is licensed under the MIT License - see the LICENSE file for details.
Here are a few common questions and answers to get you started:
Q: Will using these scripts affect my API call limit with Jungle Scout?
A: Yes, these scripts make live calls to the Jungle Scout API. Each call counts against your monthly limit. Please use them accordingly.
Q: Can I contribute to this project if I'm not a developer?
A: Absolutely! While contributions to the code are welcome, we also appreciate documentation improvements, bug reports, and use case suggestions.
Q: Who do I contact if I have questions or need support?
A: For now, please open an issue in this repository if you find a bug. For support with Jungle Scout's API, please contact Jungle Scout at [email protected].
Please use these projects at your own risk. These scripts interact with the Jungle Scout API in real time, consuming your available call limit. Always test scripts in a controlled environment before applying them to critical operations.