Import Torn API Data to Google Sheets
In this guide, we’ll walk through how to pull player and market data from the Torn API directly into Google Sheets, using the API Connector add-on. We’ll first get an API key from Torn, and then set up a request to pull in information from Torn to your spreadsheet.
- Before You Begin
- Step 1: Get your Torn API Key
- Step 2: Create your API Request URL
- Step 3: Pull Torn API Data into Sheets
- Step 4: Get More Data
BEFORE YOU BEGIN
Click here to install the API Connector add-on from the Google Marketplace.
STEP 1: GET YOUR TORN API KEY
- While logged into Torn, click the Preferences icon in the top right corner.
- Click on API Key. That’s it! You’ll see your API key displayed. Copy this and keep it safe; we’ll need it shortly.
STEP 2: CREATE YOUR API REQUEST URL
We’ll first follow the Torn API documentation to access item data.
- API root: https://api.torn.com
- Query Strings: ?selections=items&key=YOUR_API_KEY
Putting it all together, we get the full API Request URL:
STEP 3: PULL TORN API DATA INTO SHEETS
Now let’s enter our URL into API Connector and import Torn data into Google Sheets.
- Open up Google Sheets and click Add-ons > API Connector > Open.
- In the Create screen, enter the Request URL we just created
- We don’t need any headers, so just leave that section blank. We don’t need extra authorization either.
- Create a new tab and click ‘Set current’ to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see item stats printed into your sheet.
STEP 4: GET MORE DATA
- You can check the documentation for the full list of available API requests, but if you just want to jump in, you can play around with the URLs you enter in the API URL path field. Try the following (one at a time):
- By default, some of the Torn API’s endpoints will return data that gets parsed into separate columns. You can select API Connector’s compact report style for a more compact output with fewer columns.
- Click the Try It! button for a convenient way to construct and try out requests in the browser before copying them into API Connector. From there, you can simply copy and paste their auto-created URL into the API Connector request URL field.