Intersection of two lists
The intersection of two lists is the collection of items that appear in both inputs.
Run — free
This tool performs that comparison directly and returns each shared value once, following the order in which it first appears in the first list. It is useful when keyword exports overlap, tag sets need reconciliation, allowlists must be compared, or two data sources need a quick common subset. Matching is exact by default, while optional case-insensitive comparison handles capitalization differences without changing the returned spelling.
Prepare two lists for a meaningful comparison
Place the reference values in the first list and the values you want to compare against them in the second. Every entry must be text, which keeps matching predictable for keywords, tags, product codes, labels, names, and similar data. The operation does not trim spaces, change punctuation, or guess whether two differently formatted values mean the same thing. For example, an entry with a trailing space is distinct from the same visible word without that space. Clean or normalize source data first when those differences are accidental. The first list also determines output order and spelling. If a shared item occurs several times, the result includes it only once at the position of its first occurrence in the first list. This behavior produces a mathematical set intersection while retaining a useful, stable sequence for downstream work. Both lists must contain at least one item, although the valid result may be empty when no values overlap. Each list accepts up to the published item limit so runtime remains bounded and responsive.
Choose exact or case-insensitive matching
Exact matching is the default because identifiers and labels can be case-sensitive. Under that rule, “API” and “api” are different items. Turn on ignore_case when capitalization is irrelevant, as it often is for editorial keywords, user-entered tags, or category names gathered from separate systems. Case-insensitive comparison converts values only for internal lookup; it does not rewrite the output. The returned value keeps the spelling from its first appearance in the first list. That detail makes the result safe to display and lets the first list act as the preferred vocabulary. Duplicate handling follows the same comparison rule. With ignore_case enabled, “SEO”, “seo”, and “Seo” belong to one comparison key and can produce only one output entry. The algorithm compares complete strings rather than searching for fragments, so “email” does not match “email marketing”. It also leaves accents and Unicode characters intact. Decide on normalization before calling the tool if your workflow needs locale-aware equivalence, accent removal, whitespace folding, or synonym mapping beyond straightforward letter-case differences.
Use the intersection in data workflows
The response includes the intersection array, its unique item count, the original size of each list, and the case-matching mode used. Those fields make the output easy to audit and straightforward to feed into another step. A search team can compare a planned keyword set with terms already covered on a site, then send the overlap to a review queue. A commerce application can intersect product tags with a campaign allowlist before assigning promotions. A data pipeline can compare column names or category values from two exports and stop when the common subset is unexpectedly small. Because the operation is deterministic, the same inputs and options always return the same ordered result. No network request, model inference, random choice, or current time affects the calculation. The API price is $0.002 per request, and the browser runner uses the same pure comparison logic. For reproducible automation, preserve input order, choose the case rule explicitly, and store the returned counts alongside the intersection so later reviewers can understand the scope of the comparison.
What you can do with it
Compare keyword exports
Find terms shared by two research tools or campaign lists before consolidating SEO work.
Reconcile tags
Identify the tags supported by both a content system and a destination platform.
Filter against an allowlist
Keep only requested labels or identifiers that also appear in an approved text list.
FAQ
What does the operation return?
It returns each string found in both lists once, ordered and spelled according to its first appearance in list_a.
Are duplicates included?
No. The result is a set intersection, so each matching value appears only once.
Is matching case-sensitive?
Yes by default. Set ignore_case to true when capitalization should not affect whether values match.
Does it trim spaces or punctuation?
No. Values are compared as supplied, apart from optional case-insensitive matching. Normalize source values first if needed.
What happens when nothing matches?
The request succeeds with an empty intersection array and a count of zero.
What does the API request cost?
Each API request costs $0.002.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/str/list-intersection \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"list_a":["analytics","email","seo","automation"],"list_b":["seo","content","analytics"]}'const res = await fetch("https://api.kit.forhosting.com/str/list-intersection", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"list_a": [
"analytics",
"email",
"seo",
"automation"
],
"list_b": [
"seo",
"content",
"analytics"
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/str/list-intersection",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"list_a": [
"analytics",
"email",
"seo",
"automation"
],
"list_b": [
"seo",
"content",
"analytics"
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/str/list-intersection", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"list_a":["analytics","email","seo","automation"],"list_b":["seo","content","analytics"]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"list_a":["analytics","email","seo","automation"],"list_b":["seo","content","analytics"]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/str/list-intersection", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"list_a": [
"analytics",
"email",
"seo",
"automation"
],
"list_b": [
"seo",
"content",
"analytics"
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "str.list_intersection",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_items_per_list | 10000 |
max_item_chars | 4096 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |