String docs

Writing Composer build requests

Write a Composer request that names the source, fields, scope and schedule, answer its questions well, and know when to use Web Access instead.

AI agent? Read https://usestring.ai/agent-onboarding/SKILL.md first. It gets you your own API key with one browser click, and fetch and search work with no key.

A Composer build request is the query you send to POST /v1/builds: a plain-English description of the dataset you want. Use Composer when you want a structured dataset from sources you can name, refreshed on a schedule. For a one-off question, or when you don't know yet where the data lives, use Web Access instead.

Sending a request

curl -X POST "https://feedbuilder.usestring.ai/v1/builds" \
  -H "Authorization: Bearer $STRING_FEED_BUILDER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "Laptop listings from shop.example.com in the Laptops category. For each listing: title, brand, model number, price, sale price if shown, rating, review count and listing URL. Daily."
  }'
201 Created
{ "object": "build", "id": "4c1d8a76-…" }

The request's length limit is on Limits.

What a good request says

Composer builds from what you write, so a request that answers these four questions gets a feed close to what you wanted on the first pass:

  1. Which source. Name the site, and give a URL when you have one. If you want several sites, name each one.
  2. What one row is. A product listing, a store, a job posting, a review. Say it in those words.
  3. Which fields. List the columns each row needs. If you plan to compute a metric, ask for the fields it is computed from and name the metric beside them: "average price by brand" needs each product's brand and price.
  4. Which scope and how often. The filters that bound the dataset (brands, categories, regions, ZIP codes) and the schedule you want it refreshed on.

Leave out anything you don't know. Composer asks about what it can't settle, and answers for you if a question expires before you do.

Vague and specific requests

VagueSpecific
"Laptop prices""Laptop listings from shop.example.com in the Laptops category. For each listing: title, brand, model number, price, sale price if shown, rating, review count and listing URL. Daily."
"Store data for example.com""Every store location on example.com/stores in ZIP codes 10001, 60601 and 94103. For each store: store name, street address, ZIP code, phone, opening hours and the services listed on its page. Weekly."
"Jobs at Example Co""Open job postings on careers.example.com. For each posting: title, team, location, remote or on-site, posting date and posting URL. Only postings in the United States. Weekly."

Each vague request leaves Composer to choose the source, the row, the columns or the schedule. It asks you about the ones it can't settle, and fills in the rest with its own reading.

Schedules

Say the schedule in words: "daily", "every Monday", "on the 1st of each month". Composer tells you when it changes a schedule to fit the schedule limits, and you confirm the schedule at the publish review.

Answering Composer's questions

Composer stops to ask you things during a build. Each stop is a gate. A gate with an expires_at is answered for you when that time passes, and auto-proceed is on by default; see A gate can expire.

  • The restated request comes first. The initial_query gate shows options.refined_request, Composer's reading of what you asked for. Check the source, the row and the columns before you confirm. To correct it, reply with the change in your own words, such as "also include sale price, and only the Laptops category"; Composer keeps its restatement and applies your reply.
  • An ambiguous request gets a choice. When a request can be read more than one way, Composer asks with a choice or questionnaire gate. In a questionnaire, leave out a question you are skipping rather than sending it empty, and answer at least one.
  • The schema review is where columns change. At schema_review, approve the columns or send edits: drop a column you won't use, or add a note about a field you expected.
  • The publish review ships the feed. At publish_review, check sample_rows against what you asked for. Approving publishes the feed. Rejecting withholds it and ends the build, so fix columns at schema_review, and change a published feed with Change this feed.

A short, specific answer works best at every gate: name the column, the source or the filter you mean. A text answer is accepted at every gate kind, so a reply in prose always works. The request body for each kind is on Gates.

To add a constraint while a build is running, without waiting for a gate, send it as a message. Set BUILD_ID to the id from the 201 response:

curl -X POST "https://feedbuilder.usestring.ai/v1/builds/$BUILD_ID/messages" \
  -H "Authorization: Bearer $STRING_FEED_BUILDER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "text": "Only listings under $2000." }'

204 No Content: the message is delivered. Watch the build's status, progress and gates for its effect.

Changing a published feed

To change a feed that is already published, such as adding a column, widening the scope or changing the schedule, open the feed in the portal and choose Change this feed. Describe the change the way you would write a new request: name the column, filter or schedule. The change runs as a new build with its own gates, and the published feed keeps delivering until you approve the change.

What Composer won't build

  • Sources behind a sign-in or a paywall. Composer doesn't collect from pages that need an account, a login or a payment to see the data.
  • Sources that require accepting terms first. Composer doesn't collect from pages that show their data only after you accept their terms of service.

If your request names one of these, point Composer at a public source for the same data instead. What a build costs, and when it isn't charged, is on Pricing. Request sizes and other API limits are on Limits.

Composer or Web Access

Composer and Web Access answer different questions.

You wantUse
The same fields from known sources, collected on a schedule into a datasetComposer
An answer to an open question, when you don't know which pages hold itWeb search: web_access_search in the MCP server, or POST /search
The content of pages whose URLs you already have, nowWeb fetch: web_access_fetch in the MCP server, or POST /fetch

A common pattern is to start with the MCP server: search to find which sites carry the data, fetch a few of their pages to check the fields are there, then send Composer a request that names those sites and fields. Choosing an endpoint compares the Web Access endpoints.