Claude Code
Use the terminal to search the existing catalog and review the interpreted filters.
fsc ask "Iowa compounding plants, independent founders only" --jsonRun BuyAFactory.com from your terminal, a research agent, or an automation workflow.
Install the BuyAFactory.com CLI package (fsc), generate an API key in Workspace Settings, and connect to https://buyafactory.com (or your local URL when testing). Set the CLI URL or select your profile when prompted.
export FACTORYSCOPE_API_KEY="<key from Workspace Settings>"
export FACTORYSCOPE_API_URL="https://buyafactory.com"
fsc auth login --url "$FACTORYSCOPE_API_URL" --api-key "$FACTORYSCOPE_API_KEY"
fsc ask "Midwest ISO 9001 plastics plants on Odoo" --jsonAuthorization: Bearer fsc_… authenticates the workspace that created the scoped key. A revoked or invalid key returns 401, a missing scope returns 403, and insufficient credits return 402.
Send previousPlan to refine a prior response. Requires read:factories.
curl -fsS -X POST "$FACTORYSCOPE_API_URL/api/ai/query" \
-H "Authorization: Bearer $FACTORYSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"query":"Midwest ISO 9001 plastics or compounding plants running Odoo, skip PE-backed"}'Requires Scout+ plan with run:discovery and spend:credits. Supports all, web_enrichment, openfda, epa_echo, and odoo_directory. Charges 5 credits per returned factory.
curl -fsS -X POST "$FACTORYSCOPE_API_URL/api/discovery/run" \
-H "Authorization: Bearer $FACTORYSCOPE_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"query":"Midwest ISO 9001 and FDA medical plants","source":"all","limit":5}'Requires read:factories and spend:credits. The first reveal for a workspace and factory costs 2 credits.
curl -fsS -X POST "$FACTORYSCOPE_API_URL/api/factories/fac-jeda-polymers/reveal" \
-H "Authorization: Bearer $FACTORYSCOPE_API_KEY"Use the terminal to search the existing catalog and review the interpreted filters.
fsc ask "Iowa compounding plants, independent founders only" --jsonInspect the API contract and use it to validate tool inputs before issuing a request.
curl -fsS "$FACTORYSCOPE_API_URL/api/openapi.json"Give Hermes a scoped key and budget before enabling live lookup. Use JSON output for the tool response.
fsc ask "Go pull 5 US manufacturers from Odoo" --go-fetch --jsonAdd an HTTP Request node with Method POST and JSON body. Store the API key in an n8n credential for the Authorization header.
POST /api/ai/query
Authorization: Bearer fsc_…
Content-Type: application/json
{"query":"Michigan injection molders, independent only"}