Skip to main content

Using the RB2B Profiles API with Claude

You can have Claude pull your RB2B profiles and summarise, filter or export them for you. There is no connector to install: you give Claude a short skill file and your API key, and it calls the API on your behalf.

Before you start

You need:

  • An RB2B account with API access. That means a premium plan in good standing.

  • Your RB2B API key, from My Account > Account Details > Account Settings.

  • One of the following: Claude Code installed on your computer, or a Claude account with code execution turned on.

There are two ways to set this up. Pick the one that matches how you use Claude.

Where you use Claude

Where requests run

How Claude gets your key

Claude Code (terminal)

On your own computer

An environment variable

claude.ai and the Claude apps

In Claude's sandbox

You paste it into the chat

If you have the choice, use Claude Code. Your key is read from your own machine, so you never paste it into a conversation.


Create the skill file

A skill is a short instruction file that tells Claude how to do a specific job. This one tells Claude how to call the RB2B API. Both setups use the same file.

  1. Create a folder called rb2b-profiles.

  2. Inside it, create a file called SKILL.md.

  3. Paste in the content below and save.

---
name: rb2b-profiles
description: Pull identified visitor profiles from the RB2B API. Use when the user asks for their RB2B profiles, visitors or leads, or wants them summarised, filtered or exported.
---

# RB2B profiles

Request: GET https://app.rb2b.com/api/v1/profiles
Header: Api-Key: <key>

## API key
Use the RB2B_API_KEY environment variable if it is set. If it isn't, ask the user for their key. Never print the key back or write it to a file.

## Parameters
- limit: profiles per page. Default 100, max 250. Use 250.
- since / until: ISO 8601 date or time, matched on last seen. since can't be more than 90 days back.
- cursor: the next_cursor from the previous response.

## Paging
Results come back newest first. Pass each next_cursor back as cursor until it is null. Never build or edit a cursor.

## Limits and errors
- 20 requests per minute. On a 429, wait the number of seconds in Retry-After, then continue from the same cursor.
- 401: the key is missing or wrong. Ask the user to check it.
- 403 api_access_not_allowed: the plan or billing status doesn't include API access. Tell the user and stop.

## Working with results
- The API only filters by date range. Apply any other filter (industry, title, company) after fetching.
- Save results to a file and analyse them with code. Don't paste raw profiles into the chat unless asked.

The file doesn't contain your API key, so it's safe to share with teammates.


Set up in Claude Code

Claude Code runs in your terminal and makes requests from your own computer.

  1. Add your key to your shell profile (~/.zshrc or ~/.bashrc), replacing the example with your own key:

    export RB2B_API_KEY="r_live_XXXXXXXXXXXXXXXXXXXXXXXXXX_abc123"
  2. Close and reopen your terminal so the change takes effect.

  3. Move the rb2b-profiles folder into your personal skills folder, so the file sits at ~/.claude/skills/rb2b-profiles/SKILL.md:

    mkdir -p ~/.claude/skills mv rb2b-profiles ~/.claude/skills/
  4. Start Claude Code by running claude.

  5. Ask for your profiles, for example: "Pull my RB2B profiles from the last 7 days and group them by company."

  6. Claude will ask permission before it runs the request. Approve it.

Personal skills are available in every project on that computer. To share the skill with your team through a repository, put the folder in the project's .claude/skills/ directory instead. See Extend Claude with skills for more.


Set up in claude.ai and the Claude app

In chat, Claude runs code in a sandbox that can't reach app.rb2b.com until you allow it. Do the setup once on the web or in the desktop app. The settings belong to your account, so they also apply in the mobile app.

Step 1: Allow Claude to reach RB2B

  1. Open Settings > Capabilities.

  2. Turn on Code execution and file creation.

  3. Turn on Allow network egress.

  4. Under Additional allowed domains, add app.rb2b.com.

On Team and Enterprise plans, network access is off by default and only an organisation owner can change it, in Organization settings > Capabilities. Ask your owner to add app.rb2b.com to the allowed domains. Anthropic's guide to code execution and network access covers these settings.

Step 2: Upload the skill

  1. Compress the rb2b-profiles folder into a ZIP file.

  2. In Claude, open Customize > Skills.

  3. Click +, then Create skill, then Upload a skill.

  4. Upload the ZIP file.

See Use skills in Claude if the upload option is missing.

Step 3: Make your first request

  1. Start a new chat.

  2. Ask for your profiles, for example: "Pull my RB2B profiles from the last 7 days and group them by company."

  3. Paste your API key when Claude asks for it.


Keep your key safe

Your key becomes part of any conversation you paste it into. Don't share those chats, and don't add the key to the skill file if you plan to share the skill. If you think the key has been exposed, regenerate it in My Account.


Things to ask

Once it's set up, describe what you want in plain language. Some examples:

  • "Pull my RB2B profiles from the last 7 days and group them by company."

  • "Which companies had more than one visitor this week?"

  • "List everyone who viewed our pricing page since Monday, with title and company."

  • "Show me visitors from software companies with 51 to 200 employees in the last 30 days."

  • "Export yesterday's profiles to a spreadsheet."

  • "Which referrers sent the most identified visitors this month?"

A few things to keep in mind:

  • The API only filters by date. Claude pulls the date range, then applies other filters itself, so a narrower range is faster.

  • The API goes back 90 days. For older history, use the CSV export on the Profiles page.

  • Large pulls take time. At 20 requests per minute, Claude can fetch up to 5,000 profiles a minute.


Troubleshooting

What you see

Likely cause

What to do

Claude says it can't reach app.rb2b.com, or the request is blocked

Network access isn't set up for that domain

In claude.ai, check that Allow network egress is on and app.rb2b.com is in the allowed domains. Start a new chat after changing it.

The allowed domains option is missing or greyed out

You're on a Team or Enterprise plan

Ask your organisation owner to add the domain.

Claude doesn't use the skill

The skill isn't installed or enabled

In Claude Code, check the file is at ~/.claude/skills/rb2b-profiles/SKILL.md. In claude.ai, check the skill is switched on in Customize > Skills. You can also say "use the rb2b-profiles skill".

Claude Code asks for your key

The environment variable isn't set in that terminal

Reopen the terminal, then run echo $RB2B_API_KEY to confirm it prints your key.

401 error

The key is missing, mistyped or has been regenerated

Copy the current key from My Account and try again.

403 with api_access_not_allowed

Your plan or billing status doesn't include API access

Check your plan and billing in RB2B.

429 error

More than 20 requests in a minute

Claude should wait and continue on its own. If it stops, ask it to carry on.

Did this answer your question?