Search API Connector Documentation
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
- Part 1: Get your Torn API Key
- Part 2: Create your API Request URL
- Part 3: Pull Torn API Data into Sheets
- Part 4: More Example API URLs
- Part 5: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 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.
Part 2: Create Your API Request URL
We’ll first get some 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:
Part 3: Pull Torn API Data into Sheets
Now let’s copy that URL into API Connector.
- Open up Google Sheets and click Extensions > API Connector > Open.
- In the Create screen, enter the Request URL we just created
- We don’t need any OAuth, so just leave that set to None. We don’t need headers either, so just leave that section blank.
- 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.
Part 4: More Example API URLs
- 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 grid report style for a more compact output with fewer columns.
Part 5: API Documentation
Official API documentation: https://www.torn.com/api.html
In the documentation, click the Try It! button for a convenient way to construct and try out requests in the browser before copying them into API Connector. You can simply copy and paste their auto-created URL into the API Connector request URL field.