API Documentation

Everything you need to integrate the RichAPI API into your product.

Utilities

Clean Domain

Normalize a messy URL or domain string to a clean root domain (e.g. https://www.acme.com/page → acme.com).

POST
/api/v1/clean_domain
0.5 credits per call

Parameters

FieldTypeRequiredDescription
messy_urlstringYesURL or domain to normalize (e.g. https://www.Example.COM/page?q=1)

Response fields

FieldTypeDescription
domainstringClean root domain (e.g. acme.com)

Code

curl -X POST https://api.richapi.ai/api/v1/clean_domain \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "messy_url": "https://www.acme.com/about?ref=google"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Normalize Phone

Parse and normalize a phone number to E.164 format with optional country code hint.

POST
/api/v1/normalize_phone
0.5 credits per call

Parameters

FieldTypeRequiredDescription
phone_numberstringYesPhone number to normalize (any format)
country_codestringNoISO country code hint (e.g. US)

Response fields

FieldTypeDescription
e164stringNormalized phone number in E.164 format (e.g. +14155551234)
nationalstringFormatted national number (e.g. (415) 555-1234)
countrystringDetected country code
validbooleanWhether the number is valid

Code

curl -X POST https://api.richapi.ai/api/v1/normalize_phone \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "country_code": "US",
  "phone_number": "(415) 555-1234"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Extract URLs & Emails

Extract all URLs and email addresses from a block of text.

POST
/api/v1/extract_urls_emails
0.5 credits per call

Parameters

FieldTypeRequiredDescription
textstringYesText block to extract URLs and emails from

Response fields

FieldTypeDescription
emailsarrayList of email addresses found in the text
urlsarrayList of URLs found in the text

Code

curl -X POST https://api.richapi.ai/api/v1/extract_urls_emails \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Contact us at hello@acme.com or visit https://acme.com"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Find Redirect

Follow a URL through all redirects and return the final destination URL.

POST
/api/v1/find_redirect
1 credit per call

Parameters

FieldTypeRequiredDescription
linkstringYesURL to follow through all redirects to the final destination

Response fields

FieldTypeDescription
final_urlstringFinal destination URL after all redirects
redirect_chainarrayList of intermediate URLs in the redirect chain
status_codeintegerFinal HTTP status code

Code

curl -X POST https://api.richapi.ai/api/v1/find_redirect \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "link": "https://bit.ly/example"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Identify Email Type

Classify an email address as personal, business, role-based, or disposable.

POST
/api/v1/identify_email_type
0.5 credits per call

Parameters

FieldTypeRequiredDescription
emailstringYesEmail address to classify

Response fields

FieldTypeDescription
typestringEmail type: personal, business, role, or disposable
domainstringEmail domain

Code

curl -X POST https://api.richapi.ai/api/v1/identify_email_type \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "email": "john.doe@gmail.com"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Normalize Company

Clean and normalize a company name by removing legal suffixes, extra whitespace, and punctuation.

POST
/api/v1/normalize_company
0.5 credits per call

Parameters

FieldTypeRequiredDescription
company_namestringYesCompany name to normalize (e.g. ACME TECHNOLOGIES, INC.)
normalize_casebooleanNoConvert to title case (default true)

Response fields

FieldTypeDescription
normalizedstringCleaned company name with legal suffixes and punctuation removed

Code

curl -X POST https://api.richapi.ai/api/v1/normalize_company \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "company_name": "ACME TECHNOLOGIES, INC."
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Predict Gender

Predict the gender of a person from their first name.

POST
/api/v1/predict_gender
1 credit per call

Parameters

FieldTypeRequiredDescription
namestringYesFirst name to predict gender for

Response fields

FieldTypeDescription
genderstringPredicted gender: male, female, or unknown
confidencenumberConfidence score (0-1)

Code

curl -X POST https://api.richapi.ai/api/v1/predict_gender \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Jordan"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Format Datetime

Parse and reformat a date/time string with optional timezone conversion and locale.

POST
/api/v1/format_datetime
0.5 credits per call

Parameters

FieldTypeRequiredDescription
datestringYesDate/time string to parse (ISO 8601 or common formats)
formatstringNostrftime format string for output (e.g. %B %d, %Y)
original_timezonestringNoTimezone of the input date (e.g. UTC)
new_timezonestringNoTarget timezone for output (e.g. America/New_York)
localestringNoLocale for month/day names (e.g. en, fr)

Response fields

FieldTypeDescription
formattedstringReformatted date/time string
isostringISO 8601 representation of the parsed date/time
timezonestringTimezone used for the output

Code

curl -X POST https://api.richapi.ai/api/v1/format_datetime \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "date": "2026-04-11T14:30:00Z",
  "format": "%B %d, %Y",
  "new_timezone": "America/New_York"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Encode URI

URL-encode a string for safe use in query parameters or path segments.

POST
/api/v1/encode_uri
0.5 credits per call

Parameters

FieldTypeRequiredDescription
valuestringYesString to URL-encode (RFC 3986)

Response fields

FieldTypeDescription
encodedstringURL-encoded output string

Code

curl -X POST https://api.richapi.ai/api/v1/encode_uri \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "value": "hello world & foo=bar"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Find Sitemap URLs

Discover and filter URLs from a domain's sitemap by keyword.

POST
/api/v1/find_sitemap_urls
1 credit per call

Parameters

FieldTypeRequiredDescription
domainstringYesDomain to discover sitemap URLs from (e.g. stripe.com)
keywordsstringNoComma-separated keywords to filter URLs
exact_matchbooleanNoMatch keywords exactly (default false)

Response fields

FieldTypeDescription
urlsarrayFiltered list of sitemap URLs matching the keyword
totalintegerTotal URLs found before filtering

Code

curl -X POST https://api.richapi.ai/api/v1/find_sitemap_urls \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "domain": "stripe.com",
  "keywords": "pricing"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Distribute Leads

Round-robin distribute leads across a set of assignment labels (e.g. sales reps).

POST
/api/v1/distribute_leads
0.5 credits per call

Parameters

FieldTypeRequiredDescription
assignment_labelsstringNoComma-separated assignment labels (e.g. Team A,Team B,Team C)
values_associated_with_labelsstringYesComma-separated values to distribute (e.g. alice@co.com,bob@co.com)
current_indexintegerNoStarting index for round-robin (default 0)

Response fields

FieldTypeDescription
assignmentsarrayList of {label, value} assignment pairs
next_indexintegerNext index to use for the following batch

Code

curl -X POST https://api.richapi.ai/api/v1/distribute_leads \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "current_index": 0,
  "assignment_labels": "Team A,Team B,Team C",
  "values_associated_with_labels": "alice@co.com,bob@co.com,carol@co.com"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Normalize List

Split a delimited string into a clean list, optionally removing empty values.

POST
/api/v1/normalize_list
0.5 credits per call

Parameters

FieldTypeRequiredDescription
inputstringYesDelimited string to split and deduplicate
remove_empty_valuesbooleanNoRemove empty items after splitting (default false)

Response fields

FieldTypeDescription
listarrayResulting list of string items

Code

curl -X POST https://api.richapi.ai/api/v1/normalize_list \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "apple, Banana, apple, , cherry",
  "remove_empty_values": true
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Remove Whitespace

Strip and collapse extra whitespace from a string.

POST
/api/v1/remove_whitespace
0.5 credits per call

Parameters

FieldTypeRequiredDescription
input_textstringYesString to strip and collapse whitespace from

Response fields

FieldTypeDescription
outputstringString with leading/trailing whitespace stripped and internal runs collapsed to a single space

Code

curl -X POST https://api.richapi.ai/api/v1/remove_whitespace \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input_text": "  hello   world  "
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try

Count Occurrences

Count how many times a substring appears in a string, with optional case-insensitive matching.

POST
/api/v1/count_occurrences
0.5 credits per call

Parameters

FieldTypeRequiredDescription
inputstringYesInput string to search within
separatorstringYesSubstring to count occurrences of
case_insensitivebooleanNoCase-insensitive matching (default false)
limitintegerNoMax results to return (0 for all, max 1000)

Response fields

FieldTypeDescription
countintegerNumber of times the separator appears in the input

Code

curl -X POST https://api.richapi.ai/api/v1/count_occurrences \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "foo bar foo baz",
  "separator": "foo"
}'

Try it

Sign in to test this endpoint with your API key.

Sign in to try