# LinkedIn data in LangChain. Pay per record.

> A LangChain tool for LinkedIn data: profiles, companies, posts and jobs, priced per record with a quote before every call. Copy the code.

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

Wrap one function as a LangChain tool and any LangChain or LangGraph agent can look up LinkedIn people, companies, posts and jobs, and see what each lookup cost.

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

## The tool

python · langchain:

```python
import os, requests

BASE = "https://apiforagents.dev"
KEY = os.environ["AFA_KEY"]  # an API key from the console, or an agent's token

def linkedin(op: str, **params) -> dict:
    """Call one LinkedIn operation. Add estimateOnly=True for a free quote."""
    r = requests.post(
        f"{BASE}/v1/linkedin",
        headers={"Authorization": f"Bearer {KEY}"},
        json={"op": op, **params},
        timeout=120,
    )
    body = r.json()
    if r.status_code != 200:
        raise RuntimeError(f"{body.get('error')}: {body.get('error_description')}")
    return body  # read body["coverage"] and body["notes"] before body["data"]

from langchain_core.tools import tool

@tool
def linkedin_profiles(handles: list[str]) -> dict:
    """Look up LinkedIn profiles by /in/<handle> or profile URL (up to 10).
    Returns name, headline, location, skills and positions per person."""
    return linkedin("profiles", subjects=handles)
```

## Give it to an agent

python · langgraph:

```python
from langgraph.prebuilt import create_react_agent

agent = create_react_agent("anthropic:claude-sonnet-5-5", tools=[linkedin_profiles])
agent.invoke({"messages": [("user", "What does satyanadella do now, per LinkedIn?")]})
```

> **Budget per run** Pass maxUsd in a call and the API refuses anything that would cost more, before it spends: a hard ceiling an agent cannot talk its way past.

## Other platforms in this tool

- [Instagram in LangChain](https://apiforagents.dev/integrations/langchain/instagram)
- [YouTube in LangChain](https://apiforagents.dev/integrations/langchain/youtube)
- [X / Twitter in LangChain](https://apiforagents.dev/integrations/langchain/x_twitter)
- [Reddit in LangChain](https://apiforagents.dev/integrations/langchain/reddit)
- [TikTok in LangChain](https://apiforagents.dev/integrations/langchain/tiktok)
- [Facebook in LangChain](https://apiforagents.dev/integrations/langchain/facebook)
- [Amazon in LangChain](https://apiforagents.dev/integrations/langchain/amazon)
- [Shopify in LangChain](https://apiforagents.dev/integrations/langchain/shopify)
- [Farfetch in LangChain](https://apiforagents.dev/integrations/langchain/farfetch)
- [GOAT in LangChain](https://apiforagents.dev/integrations/langchain/goat)
- [StockX in LangChain](https://apiforagents.dev/integrations/langchain/stockx)
- [Blinkit in LangChain](https://apiforagents.dev/integrations/langchain/blinkit)
- [Swiggy Instamart in LangChain](https://apiforagents.dev/integrations/langchain/instamart)
- [Zepto in LangChain](https://apiforagents.dev/integrations/langchain/zepto)
- [Indeed in LangChain](https://apiforagents.dev/integrations/langchain/indeed)
- [Naukri in LangChain](https://apiforagents.dev/integrations/langchain/naukri)
- [Upwork in LangChain](https://apiforagents.dev/integrations/langchain/upwork)
- [Contacts in LangChain](https://apiforagents.dev/integrations/langchain/contacts)
- [Google Maps in LangChain](https://apiforagents.dev/integrations/langchain/google_maps)
- [Yelp in LangChain](https://apiforagents.dev/integrations/langchain/yelp)
- [Tripadvisor in LangChain](https://apiforagents.dev/integrations/langchain/tripadvisor)
- [Airbnb in LangChain](https://apiforagents.dev/integrations/langchain/airbnb)
- [Booking.com in LangChain](https://apiforagents.dev/integrations/langchain/booking)
- [Google in LangChain](https://apiforagents.dev/integrations/langchain/google)

## Questions

### Is there an official LangChain package?

No package is needed. The tool above is a plain HTTP call; copy it into your project and add the operations you need.

### 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
