Import Clickbank Data to Google Sheets

Table of Contents

Import Clickbank Data to Google Sheets

Clickbank is an affiliate marketing network. In this guide, we’ll walk through how to pull affiliate marketing data from the Clickbank API directly into Google Sheets, using the API Connector add-on for Sheets. We'll first get our API key(s) from Clickbank, and then set up a request to pull in information from Clickbank to your spreadsheet.

PART 1: GET YOUR CLICKBANK CLERK API KEY

  1. While logged into your Clickbank master account (https://accounts.clickbank.com/), click the User icon on the left-hand menu, and then the Create New User button.
    clickbank-img1
  2. Check the 'API-only user box', give your new user (aka 'clerk') a description, and click Save.
    clickbank-img2
  3. You'll now see your Clerk API key. Copy this and keep it safe; we'll need it shortly. On this page, you can also choose the reports that this key should have access to.
    clickbank-img3

PART 2: GET YOUR CLICKBANK DEVELOPER API KEY

  1. Still in the Master Account, click the Account icon on the left-hand menu, and then on the name of your linked account.
    clickbank-img4
  2. Click on Account Settings
    clickbank-img5
  3. Scroll down the page to the Developer API Keys section and click Edit
    clickbank-img6
  4. Click Create New Developer Key.
    clickbank-img7
  5. Give your key a simple description and click Save.
    clickbank-img8
  6. You'll now see your developer API key. Copy this down as we'll need it in a moment.
    clickbank-img9

PART 3: CREATE YOUR API REQUEST URL

We’ll first follow the Clickbank API documentation to get a list of orders.

  • API root: https://api.clickbank.com/rest/1.3
  • Endpoint: /orders2/list

Putting it together, we get the full API Request URL:

https://api.clickbank.com/rest/1.3/orders2/list

PART 4: PULL CLICKBANK API DATA INTO SHEETS

We can now enter all our values into API Connector and import Clickbank data into Google Sheets.

  1. Open up Google Sheets and click Add-ons > API Connector > Create New API Request.
  2. In the Create Request interface, enter the Request URL we just created
    clickbank-img10
  3. Under Headers, enter the following two sets of key-value pairs, like this:
    Acceptapplication/json
    Authorizationyour_developer_api_key:your_clerk_api_key

    Clickbank authorizes by combining the developer API key with the clerk API key, so replace your_developer_api_key and your_clerk_api_key with the developer and clerk API keys you created above (make sure to separate them with a colon).
    clickbank-img11

  4. Create a new tab. You can call it whatever you like, but here we'll call it 'Orders'. While still in that tab, click 'Set' to use that tab as your data destination.
  5. Name your request. Again we'll call it 'Orders'
  6. Click Run and a moment later you’ll see order statistics printed into your sheet.
    clickbank-img12

PART 5: MORE EXAMPLE API URLs

  1. Check the documentation for the full list of available API requests. For example:
    • get summary stats (account nickname, date, sales, refunds, chargebacks)
      https://api.clickbank.com/rest/1.3/quickstats/list
    • retrieve information from the analytics API (substitute in your account nickname)
      https://api.clickbank.com/rest/1.3/analytics/affiliate/vendor_product_sku?account=ACCOUNT_NICKNAME
    • filter the analytics API for specific fields (again, substitute in your account nickname)
      https://api.clickbank.com/rest/1.3/analytics/affiliate/vendor?select=net_sale_amount&select=hop_count&select=net_sale_count&account=ACCOUNT_NICKNAME
  2. By default, some of the Clickbank API 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.

PART 6: HANDLE PAGINATION


Clickbank's API returns just 100 rows at a time, as described here.
clickbank-img13

To get more, set the page number in the header, like this:
clickbank-img14

IMPORTANT SECURITY NOTE

Anyone with Owner or Edit access to your Google Sheet can view all the information you've saved within API Connector, including API keys and other credentials. Treat these keys as passwords and limit access to your sheet accordingly.

Comments:0

Leave a Reply

Your email address will not be published.