Skip to main content
Rodz API
FR EN
v2.0.0

How-to / Integrate the API / API REST

How do you bulk-enrich contacts and read LinkedIn posts through the Rodz API?

Updated on · View on the site · Markdown version

In short

Send up to 50,000 LinkedIn profiles to POST /api/v1/enrichment/contacts/bulk, then get the result by webhook or with GET /api/v1/enrichment/contacts/bulk/{batch_id}. A found profile costs 0.5 credit live and 0.25 cached. For posts, company-posts and profile-posts list them, and post-comments and post-reactions return the people who commented or reacted, at 0.5 credit per page for three of them.

Key points

  • One POST /api/v1/enrichment/contacts/bulk call accepts 1 to 50,000 profiles; each found profile costs 0.5 credit with freshness=live and 0.25 credit with freshness=cached. A profile that is not found is not charged.
  • Above 5,000 profiles, the reference recommends deliveryMode: poll: a 50,000-profile batch weighs 50 to 150 MB, and you read it in pages instead of receiving it in a single push.
  • A batch’s results stay readable for 7 days after it finishes; after that, or for an unknown id, the API answers 404.
  • company-posts, post-comments and post-reactions cost 0.5 credit per page, charged only if the page has results.
Cost
0.25 to 0.5 credit per profile found in a batch; 0.5 credit per page for company-posts, post-comments and post-reactions (cost of profile-posts not specified)
Setup time
30 min

Before you start

  • A Rodz API key, created under Integrations → API in the dashboard (format USR_...), stored in the RODZ_API_KEY variable.
  • Credits on the account: an insufficient balance returns a 402 response.
  • The URLs of the LinkedIn profiles to enrich. For posts, the URL of a company page or a profile, or the URL of a post.
  • To receive a batch by webhook: an HTTPS URL that accepts a POST. Without one, use poll mode.
  • Python 3 with the requests library (pip install requests), or just curl.

Steps

  1. Step 1. Start a batch enrichment

    POST /api/v1/enrichment/contacts/bulk takes a JSON body with profiles, 1 to 50,000 items. Each item carries url (the LinkedIn profile URL, required) and externalId, your own reference, which you get back in the result.

    Three settings complete the body. freshness is live (the default: the profile is re-read at batch time, 0.5 credit per found profile) or cached (profile served from the cache, at most 8 days old, 0.25 credit, typically around a minute). deliveryMode is webhook (the default) or poll. webhookUrl is an HTTPS URL: required in webhook mode, optional in poll mode.

    The API answers 202 right away: data.batchId identifies the batch and data.accepted gives the number of profiles accepted. Profiles that are not found are not charged, and the price is the same by webhook or by polling.

    Start a batch in poll mode

    curl -X POST "https://api.rodz.io/api/v1/enrichment/contacts/bulk" \
      -H "Authorization: Bearer $RODZ_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "profiles": [
          {"externalId": "crm-123", "url": "https://www.linkedin.com/in/jane-doe"},
          {"externalId": "crm-456", "url": "https://www.linkedin.com/in/john-smith"}
        ],
        "freshness": "cached",
        "deliveryMode": "poll"
      }'
  2. Step 2. Receive the batch by webhook or read it in pages

    In webhook mode, the API sends the full batch as a POST to your webhookUrl when processing ends: batchId, total, found and results. In poll mode, nothing is pushed: you read the batch with GET /api/v1/enrichment/contacts/bulk/{batch_id}. If you also give a webhookUrl in poll mode, you receive only a small ready-notification, not the data.

    Reading also works as a fallback in webhook mode, for example after a missed webhook. data.status follows the cycle pending, processing, then done or failed; delivery_failed exists only in webhook mode and means your server rejected the push although the enrichment finished. Poll every few seconds while the status is pending or processing. results stays empty until the batch is done, and total and found are null until it ends.

    The limit parameter sets the page size (1,000 by default, 10,000 at most). When results remain, data.nextCursor is set: send it back as cursor for the next page. Each item of results carries externalId, url and person.

    poll_bulk.py

    import os
    import sys
    import time
    
    import requests
    
    BASE = "https://api.rodz.io/api/v1/enrichment"
    HEADERS = {"Authorization": f"Bearer {os.environ['RODZ_API_KEY']}"}
    batch_id = sys.argv[1]  # the data.batchId received with the 202
    
    params = {"limit": 1000}
    found = []
    results = []
    while True:
        response = requests.get(
            f"{BASE}/contacts/bulk/{batch_id}",
            headers=HEADERS,
            params=params,
            timeout=60,
        )
        response.raise_for_status()
        data = response.json()["data"]
        if data["status"] in ("pending", "processing"):
            time.sleep(5)
            continue
        if data["status"] != "done":
            raise SystemExit(f"Batch ended with status {data['status']}")
        results.extend(data["results"])
        for item in data["results"]:
            person = item.get("person")
            if person is None:
                print(item["externalId"], "not found", item.get("error"))
            else:
                print(item["externalId"], person["name"], person["headline"])
                found.append(item["externalId"])
        if not data["nextCursor"]:
            break
        params["cursor"] = data["nextCursor"]
    
    print(len(found), "profiles enriched")
  3. Step 3. Read the enriched profile and handle profiles without a result

    Each person is a full profile: identity (firstName, lastName, name, linkedInUrl, photoUrl), role (headline, seniority, jobFunction, subRole, industry), location (location, country, geoId), reach (followerCount, connectionsCount), linkedinSummary, skills (skillsList), languages (languages), current and past positions (currentCompanyDetail, pastCompaniesDetails, with the company’s details: industry, staff range, HQ, website) and education. Any field is null when the profile does not have it.

    person is null, or the key is missing, for a profile that is not found, and you will meet some in a batch: test it before reading fields. When a profile’s lookup could not complete, person is also null and the item carries an extra error with the code SERVICE_UNAVAILABLE. That profile is not charged, the rest of the batch is delivered, and you can submit it again later.

    A batch profile does not have the same shape as the one from GET /api/v1/enrichment/contact: do not merge the two into one data model. languagesDetail and skillsDetail are free-form: read them defensively.

    retry_unavailable.py

    # results: the list filled by poll_bulk.py
    to_retry = [
        item
        for item in results
        if item.get("person") is None
        and (item.get("error") or {}).get("code") == "SERVICE_UNAVAILABLE"
    ]
    profiles = [
        {"externalId": item["externalId"], "url": item["url"]}
        for item in to_retry
    ]
    print(len(profiles), "profiles to submit in a new batch")
  4. Step 4. List a company’s posts with company-posts

    GET /api/v1/enrichment/company-posts returns the LinkedIn posts of a company page, newest first. Pass one of these three parameters, at least one: company (the page URL), companyId (the LinkedIn id) or companyUniversalName (the last segment of the URL, the fastest form). With none of them, the API answers 400 with MISSING_PARAMETERS.

    scrapePostedLimit narrows the time window: 1h, 24h, week, month, 3months, 6months or year. To walk through pages, send the value of data.pagination.paginationToken back in paginationToken; page also allows numeric pagination.

    Each item of data.elements carries id, linkedinUrl, content, author, postedAt (with date), postImages and engagement (likes, comments, shares and reactions, a count per type). The comments field of each post is always an empty array: to read comments, use post-comments. The call costs 0.5 credit per page; an empty page is returned without being charged. data is null when no post is found, and reason then gives the reason.

    company_posts.py

    import os
    
    import requests
    
    BASE = "https://api.rodz.io/api/v1/enrichment"
    HEADERS = {"Authorization": f"Bearer {os.environ['RODZ_API_KEY']}"}
    
    params = {"companyUniversalName": "acme", "scrapePostedLimit": "month"}
    for _ in range(10):  # 10 pages at most
        response = requests.get(
            f"{BASE}/company-posts", headers=HEADERS, params=params, timeout=60
        )
        response.raise_for_status()
        data = response.json()["data"]
        if not data or not data["elements"]:
            break
        for post in data["elements"]:
            posted_at = (post.get("postedAt") or {}).get("date")
            likes = (post.get("engagement") or {}).get("likes")
            print(posted_at, likes, post["linkedinUrl"])
        token = (data.get("pagination") or {}).get("paginationToken")
        if not token:
            break
        params["paginationToken"] = token
  5. Step 5. List a person’s posts with profile-posts

    GET /api/v1/enrichment/profile-posts does the same for a profile. Pass at least one of these parameters: profile (the profile URL), profileId (the LinkedIn id) or profilePublicIdentifier (the last segment of the URL, the fastest). With none of them, the API answers 400 with MISSING_PARAMETERS.

    scrapePostedLimit, page and paginationToken work as for company-posts, and the response has the same shape. For a profile’s posts only, it adds document (an attached document or carousel), repostedBy and repostedAt when the item is a repost. postVideo is part of the shape common to both routes, when the post carries a native video. The reference gives no cost for this route, so this guide announces none.

    Posts from the last month

    curl -G "https://api.rodz.io/api/v1/enrichment/profile-posts" \
      -H "Authorization: Bearer $RODZ_API_KEY" \
      --data-urlencode "profilePublicIdentifier=jane-doe" \
      --data-urlencode "scrapePostedLimit=month"
  6. Step 6. Read a post’s comments with post-comments

    GET /api/v1/enrichment/post-comments returns the people who commented on a post, with their exact words. post is required: the LinkedIn post URL or its activity id. sortBy is relevance (the default) or date. page (from 1) or paginationToken walk through the pages.

    Each item of data.elements gives commentId, commentUrl, id (the commenter’s LinkedIn id, not the comment’s), name, linkedinUrl, position, pictureUrl, commentText, createdAt and isAuthor. Use commentId as the de-duplication key: it is stable for a comment. position, pictureUrl and createdAt can be null. When pages remain, data.pagination.paginationToken is set; it is absent on the last one. The call costs 0.5 credit per page that returns commenters; an empty page is free.

    post_comments.py

    import os
    
    import requests
    
    BASE = "https://api.rodz.io/api/v1/enrichment"
    HEADERS = {"Authorization": f"Bearer {os.environ['RODZ_API_KEY']}"}
    
    params = {"post": "https://www.linkedin.com/feed/update/urn:li:activity:1234567890", "sortBy": "date"}
    seen = set()
    while True:
        response = requests.get(
            f"{BASE}/post-comments", headers=HEADERS, params=params, timeout=60
        )
        response.raise_for_status()
        data = response.json()["data"]
        if not data or not data["elements"]:
            break
        for comment in data["elements"]:
            if comment["commentId"] in seen:
                continue
            seen.add(comment["commentId"])
            print(comment["name"], comment["position"], comment["commentText"])
        token = (data.get("pagination") or {}).get("paginationToken")
        if not token:
            break
        params["paginationToken"] = token
  7. Step 7. Read the reactions to a post with post-reactions

    GET /api/v1/enrichment/post-reactions returns the people who reacted to a post. post is required (the post URL or its activity id), and page and paginationToken walk through the pages.

    Each item of data.elements gives id, name, linkedinUrl, position, pictureUrl and reactionType, which is LIKE, PRAISE, EMPATHY, APPRECIATION, INTEREST or ENTERTAINMENT. The next-page token is in data.pagination.paginationToken, absent on the last page. The call costs 0.5 credit per page that contains people; an empty page is free.

    Reactions to a post

    curl -G "https://api.rodz.io/api/v1/enrichment/post-reactions" \
      -H "Authorization: Bearer $RODZ_API_KEY" \
      --data-urlencode "post=https://www.linkedin.com/feed/update/urn:li:activity:1234567890"
  8. Step 8. Handle refusals: parameters, credits, limits and unknown batches

    • 400 with MISSING_PARAMETERS (company-posts, profile-posts): no search parameter was supplied. Add at least one.
    • 402 with NO_MORE_CREDITS: the balance does not cover the call. Nothing was looked up or charged. Top up the account and retry.
    • 422: a field is missing or invalid (for example profiles for the batch, or post for comments and reactions).
    • 404 when reading a batch: the id is unknown for your account, it belongs to another account, or the results are more than 7 days old.
    • 429: more than 9,000 requests in the minute for this key. Retry-After gives the seconds left (1 to 60); wait, then send the same request again. A refused request is not charged.

Example payload

Response of GET /api/v1/enrichment/post-comments for one page of comments

{
  "data": {
    "elements": [
      {
        "commentId": "7469631311012577280",
        "commentUrl": "https://www.linkedin.com/feed/update/urn:li:activity:1234567890?commentUrn=example",
        "id": "ACoAAB1exampleProfileUrnZ",
        "name": "Jane Doe",
        "linkedinUrl": "https://www.linkedin.com/in/jane-doe",
        "position": "VP Engineering at Acme",
        "pictureUrl": "https://example.com/jane-doe.jpg",
        "commentText": "Congrats on the launch, this is exactly what our team needed!",
        "createdAt": "2026-05-31T15:02:00.000Z",
        "isAuthor": false
      }
    ],
    "pagination": {
      "paginationToken": "dXJuOmxpOmFjdGl2aXR5Ojc0NDU5Mzc2MjI3MTMyMjExMjA="
    }
  },
  "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

Bulk enrichment answers a question of volume: “I have a list of LinkedIn profiles, what can I learn about them?”. The post routes answer another: “what does this company or person publish, and who reacts?”. The six routes in this guide share the API key, the rate limit and the credit balance of the account.

Frequently asked questions

Should I pick webhook or poll mode for a batch?

webhook mode is the simplest for small or medium batches: the full batch arrives as a POST on your webhookUrl. Above 5,000 profiles, the reference recommends poll: a 50,000-profile batch is 50 to 150 MB, which many servers reject or time out on. In poll mode, you read the batch in pages with limit and cursor.

What does a batch cost, and what happens to profiles that are not found?

Each found profile costs 0.5 credit with live and 0.25 credit with cached. A profile that is not found is not charged, nor is one whose lookup could not complete (error with SERVICE_UNAVAILABLE). The price is the same by webhook or by polling.

What is the difference between live and cached for a batch?

live re-reads each profile at batch time: the data is the most recent, but processing is slower, especially for a large batch. cached answers from the cache: half price, typically around a minute, with profiles at most 8 days old.

What if my server missed the webhook?

Read the batch with GET /api/v1/enrichment/contacts/bulk/{batch_id}: this route also works as a fallback in webhook mode, and the cost does not change. The delivery_failed status means the enrichment finished but your server kept rejecting the push. The spec does not say whether results can be read in that state.

How do I read the comments of the posts I find with company-posts?

A post’s comments field is always an empty array in post lists, whatever engagement.comments says. Pass the post URL (linkedinUrl) as post to post-comments; post-reactions returns the people who reacted in the same way.

How much does profile-posts cost?

The API reference gives no cost for this route, so this guide announces none.