# LinkedIn data in Google Sheets. Pay per record.

> Pull LinkedIn profile data into Google Sheets with a 10-line Apps Script function: =LINKEDIN_HEADLINE(A2). Pay per record from $5.

Canonical: https://apiforagents.dev/integrations/google-sheets · Updated 2026-10-16

A small Apps Script custom function turns a column of LinkedIn URLs into headlines, companies and locations, right in the sheet.

- Works with: Google Sheets
- Price: from $0.001 / record
- Free to start: $0.10
- Setup: No SDK

## Extensions, Apps Script: paste this

apps script:

```javascript
const AFA_KEY = PropertiesService.getScriptProperties().getProperty("AFA_KEY");

/** =LINKEDIN_HEADLINE("https://www.linkedin.com/in/satyanadella") */
function LINKEDIN_HEADLINE(url) {
  const res = UrlFetchApp.fetch("https://apiforagents.dev/v1/linkedin", {
    method: "post",
    contentType: "application/json",
    headers: { Authorization: "Bearer " + AFA_KEY },
    payload: JSON.stringify({ op: "profiles", subjects: [url] }),
    muteHttpExceptions: true,
  });
  const body = JSON.parse(res.getContentText());
  const p = ((body.data || {}).profiles || [])[0];
  return p ? p.headline : body.error_description || "not found";
}
```

## Then

1. Project Settings, Script Properties: add AFA_KEY with your key, so it never sits in the sheet.
2. In a cell, type =LINKEDIN_HEADLINE(A2) and fill down.
3. Each row is one lookup at $0.004; a row looked up again the same day is free.

## Questions

### Will it re-charge every time the sheet recalculates?

A profile your account already fetched today is served free, so recalculations on the same day cost nothing. Sheets also caches custom function results.

### Where do I get a key?

Two ways. A person signs in at https://apiforagents.dev and makes an API key under Console, API keys. Or the agent signs itself up with one POST to https://apiforagents.dev/agent/identity, exchanges the identity for a token, and starts on $0.10 free; a person claims it later with a six-digit code to top up.

### What does a call cost?

LinkedIn profiles are $0.004 and companies $0.004 each, posts, comments, reactions and ads $0.002, jobs $0.001. Pay as you go from $5, nothing monthly. Add "estimateOnly": true to any call for a free quote, and records that do not come back are refunded.

## Why API for Agents

- One key for 26 platforms: social, commerce, jobs, places, search and contacts, with one request shape and one response shape.
- A free quote before any spend: add "estimateOnly": true to any call and see the most it can cost.
- Pay per record in US dollars. No subscription, nothing expires, top-ups from $5.
- $0.10 free to try, no card. An AI agent can sign itself up in one request; a person claims it later.
- Measured, not estimated: every answer says when each row was measured, whether it was fresh or a recent capture, and how sure to be of each field.
- Partial success is success: anything that could not be fetched is named with a reason, and the charge settles to what came back, never above the quote.
- Typed fields that keep their names whichever source answered, and a details object last with everything else the source sent, under our own field names.
- Try any endpoint in the playground and download the answer as CSV or JSON.

## Start

The playground runs any endpoint by hand: pick a platform and what you want from it, fill a short form named in plain words (or press Use sample input), see the free quote on the Run button, run it, then read the answer as a table or JSON and download it as CSV or JSON. The same call is written out as cURL, Python and Node while you type. Open it at https://apiforagents.dev/dashboard/run (sign in first).

Agents register at https://apiforagents.dev/auth.md (one POST, $0.10 free). People: https://apiforagents.dev/docs#start. Prices: https://apiforagents.dev/pricing.md
