Contacts → Google Sheets overview
Import Hi Energy advertiser contacts into Google Sheets with Google Apps Script. Search by domain, advertiser name, email, or free text, then flatten JSON:API contact records into a Contacts tab.
Endpoint:
GET /api/v1/contacts
Contacts list responses return JSON:API objects under data. Unverified contacts are excluded unless include_unverified=true is allowed for your account.
Setup in Google Sheets
- Open a Google Sheet → Extensions → Apps Script.
-
Get your personal API key from
API key docs.
Prefer the
X-Api-Keyheader (these samples already do). -
In Apps Script, open Project Settings → Script properties
and add
HIENERGY_API_KEYwith your key value. - Paste the shared client library, then the resource import script below.
- Click Save, reload the Sheet, and run the import from the Hi Energy AI menu (or Run in the editor).
-
On first run, authorize the script when Google prompts for
UrlFetchApp/ external request permission.
2. Contacts import script
Paste this below the shared client, save the project, then run the import function (or use the Hi Energy AI custom menu after reloading the sheet).
/**
* Import Hi Energy contacts into Google Sheets.
* Requires the shared Hi Energy client helpers in this Apps Script project.
*
* Search by domain, advertiser name, email, or free-text q.
*/
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Hi Energy AI')
.addItem('Import contacts', 'importHiEnergyContacts')
.addToUi();
}
function importHiEnergyContacts() {
var DOMAIN = ''; // e.g. 'nike.com'
var ADVERTISER_NAME = ''; // e.g. 'Nike'
var EMAIL = '';
var QUERY = '';
var page = 1;
var perPage = 100;
var allRows = [];
var maxPages = 20;
while (page <= maxPages) {
var payload = hiEnergyApiGet_('/api/v1/contacts', {
domain: DOMAIN,
advertiser_name: ADVERTISER_NAME,
email: EMAIL,
q: QUERY,
page: page,
per_page: perPage
});
var records = extractJsonApiCollection_(payload, ['data']);
if (!records.length) break;
records.forEach(function(item) {
allRows.push(flattenJsonApiItem_(item));
});
if (records.length < perPage) break;
page += 1;
}
var count = writeObjectsToSheet_('Contacts', allRows, true);
SpreadsheetApp.getActiveSpreadsheet().toast('Imported ' + count + ' contacts', 'Hi Energy AI', 5);
}Useful query parameters
| Parameter | Purpose |
|---|---|
domain |
Find contacts for an advertiser website domain. |
advertiser_name |
Match contacts by program / brand name. |
advertiser_id |
Exact advertiser id scope. |
email |
Look up a specific contact email. |
q |
Free-text search across contact fields. |
has_linkedin |
Prefer contacts that include LinkedIn profile URLs. |
include_unverified |
Include unverified contacts when your role allows it. |
FAQ
Use the Apps Script samples on this page to call GET /api/v1/contacts with your API key and write flattened contact attributes to a Contacts sheet.
Domain is usually most precise for a brand website. Advertiser name is useful for fuzzy discovery. You can combine filters.
Creating contacts uses POST /api/v1/contacts and requires create permissions (admin/paid publisher on REST). This page focuses on read/import workflows; see the Contacts API docs for create payloads.
No. Unverified contacts are excluded unless include_unverified=true is allowed for your account and you enable that filter in the importer.
Yes. Set has_linkedin in the sample filters when you want outreach lists that include LinkedIn URLs.
Yes. This page publishes TechArticle, HowTo, FAQPage, BreadcrumbList, WebSite SearchAction, and related endpoint ItemList structured data for answer engines.