search_components
Search licence-cleared components
Find existing, licence-cleared code (functions, classes, handlers, modules) mined from real
open-source repositories, before writing it from scratch. Cost: 0 credits (free). Works without
an API key with a small per-network limit; a free key raises the limits.
Every result is licence-cleared with attribution: its SPDX licence, copyright holder and a
GitHub permalink come with it.
Parameters: query (required) -- describe the job in plain words, e.g. "verify stripe webhook
signature in python". limit -- results per page (default 8; capped by plan). category -- a
function tag from list_categories, e.g. "auth". language -- python, typescript, javascript,
go, rust, java, ... . license -- 'permissive' (MIT/BSD/Apache/ISC; use it when the code goes
into a product), 'commercial-safe' (adds weak copyleft such as MPL-2.0), 'open-source' or
'any' (default). min_composite -- minimum 0-10 quality score, e.g. 7. offset -- pagination.
max_per_repo -- cap per source repo (0 = no cap).
Returns JSON {"results": [...]}, each with id, name, description, repo, path, language,
license, composite and five sub-scores, similarity and permalink. No code body: pass the id
to get_component for the source.
Example: search_components(query="express jwt auth middleware", language="javascript",
license="permissive", min_composite=7)
输入参数limitquery必填offsetlicensecategorylanguagemax_per_repomin_composite
find_similar
Find similar components
Find alternatives to a component you already have: other licence-cleared implementations of
the same job, to compare scores, licences and stacks. Cost: 0 credits (free; needs a free key).
Parameters: id (required) -- a component id from search_components. limit -- how many
(default 8).
Returns JSON {"results": [...]} in the same shape as search_components (no code body).
Example: find_similar(id="<id from search_components>", limit=5)
输入参数id必填limit
list_categories
List component categories
List the function tags (categories) in the library with how many components each has; the
values search_components accepts as `category`. Cost: 0 credits (free; needs a free key).
Parameters: limit -- how many tags, most-used first (default 40).
Returns JSON {"categories": [{"tag": ..., "count": ...}, ...]}.
Example: list_categories(limit=20)
输入参数limit
get_component
Get component source
Pull one component's full source code to reuse in the project, with its licence, copyright
holder, GitHub permalink and an attribution header to keep with the copied code. Cost: 1 credit
per call (needs a free key; refunded if the id is not available). Re-pulling a component you
already pulled still costs 1 credit.
Parameters: id (required) -- a component id from search_components or find_similar.
Returns JSON with the full source, licence, attribution header, GitHub permalink, repo, path,
language and quality scores.
Example: get_component(id="<id from search_components>")
输入参数id必填
check_component_security
Check component security
Check components or repositories for known security advisories (CVE/GHSA ids) before or
after you reuse them. Cost: 0 credits (free; needs a free key).
Advisories are repository-wide and come from our reputation data, which covers a set of widely
used repositories: "none_known" means no advisory in our data, not that the code is safe.
Parameters: component_ids -- up to 25 ids from search_components / get_component. names -- up
to 25 repositories as "owner/repo" or a GitHub URL (a bare repo name matches every owner's).
Returns JSON {"results": [...], "summary", "coverage", "note"}; each result has status
"advisories" (with ids and links), "none_known" or "not_found".
Example: check_component_security(component_ids=["<id>"], names=["nestjs/nest"])
输入参数namescomponent_ids
library_stats
Library statistics
Live size of the library: total licence-cleared components, how many carry full source,
source repositories, languages and repositories by licence class. Use it to tell the user how
much is searchable. Cost: 0 credits (free; needs a free key). No parameters.
Returns JSON counts, refreshed every 15 minutes.
Example: library_stats()
无需输入参数。
list_licenses
List source licences
List every source repository in the library with its SPDX licence and copyright holder,
i.e. the NOTICE data behind the attribution on each component. Use it to build a NOTICE file or
to check a repo's licence. Cost: 0 credits (free; needs a free key). No parameters.
Returns JSON {"licenses": [...]}, one entry per source repository.
Example: list_licenses()
无需输入参数。
get_component_bundle
Get component bundle (Pro)
Pro feature. Pull a component together with the files it imports from its own repository,
so it runs without hunting for helpers: each file with source and licence/attribution header,
plus a manifest of files, npm/pip packages and install commands. Cost: 3 credits per call (Pro
plan; other plans get an upgrade message and are not charged).
Parameters: component_id (required) -- an id from search_components.
Returns JSON with the files, manifest, licences and credits_charged.
Example: get_component_bundle(component_id="<id from search_components>")
输入参数component_id必填
compose_starter
Compose a starter project (Pro)
Pro feature. Assemble a starter project from 3-8 complementary licence-cleared components
for what you are building: file tree, files with attribution headers, a README listing every
source and licence, a NOTICE file and install commands. Cost: 10 credits per call (Pro plan;
other plans get an upgrade message and are not charged).
Parameters: prompt (required) -- what you are building, e.g. "saas with stripe billing and
magic-link login". stack -- optional, e.g. "nextjs" or "python fastapi".
Returns JSON with files, tree, readme, notice, install commands and credits_charged.
Example: compose_starter(prompt="todo api with jwt auth", stack="python fastapi")
输入参数stackprompt必填