APITube Help Center

How to Refine Your Title Search

Match the start, end or any substring of a headline with title_starts_with, title_ends_with and title_pattern

Kent Hudson

Written by Kent Hudson

June 27, 2026

Open this example in the API Playground ↗

How to refine your title search

When a plain title search returns too much, narrow it by matching a specific part of the headline: use title_starts_with to match the beginning, title_ends_with to match the end, and title_pattern to match any substring anywhere in the title. All three are query parameters on /v1/news/everything and work alongside every other filter.

curl "https://api.apitube.io/v1/news/everything?title_starts_with=breaking&api_key=YOUR_API_KEY"

You can send the key as a header (X-API-Key: YOUR_API_KEY) instead of the api_key query parameter.

How is title_pattern different from title?

The plain title parameter matches whole words (tokens) in the headline, so title=ai finds the word “AI” but not “Jamaica”. The title_pattern parameter matches a substring instead, using a LIKE '%term%' test, so it can match inside a longer word. Reach for title_pattern when you want loose, partial matching, and stick with title when you want clean word matches.

# whole-word match: finds the word "ai"
curl "https://api.apitube.io/v1/news/everything?title=ai&api_key=YOUR_API_KEY"

# substring match: also matches "email", "campaign", "detail"…
curl "https://api.apitube.io/v1/news/everything?title_pattern=ai&api_key=YOUR_API_KEY"

Because title_pattern matches partial words, keep the term specific — a short or generic substring will pull in unrelated headlines.

How to match the start or end of a headline

title_starts_with matches headlines whose title begins with your term, and title_ends_with matches headlines whose title ends with it. Both are case-insensitive (the API lowercases the title before comparing) and apply to the whole headline string, not to individual words.

# headlines that begin with "Apple"
curl "https://api.apitube.io/v1/news/everything?title_starts_with=Apple&api_key=YOUR_API_KEY"

# headlines that end with "2026"
curl "https://api.apitube.io/v1/news/everything?title_ends_with=2026&api_key=YOUR_API_KEY"

These are handy for structured headlines — alerts that lead with a keyword, recurring column names, or titles that close with a year or location.

What are the length limits and error codes?

Each refining parameter validates its length before running and returns HTTP 400 with a specific error code if the value is out of range. A value shorter than 2 characters is rejected, so always pass at least two characters:

  • title_starts_with — 2 to 100 characters, otherwise error ER0009.
  • title_ends_with — 2 to 100 characters, otherwise error ER0010.
  • title_pattern — 2 to 200 characters, otherwise error ER0011.

For comparison, the plain title parameter is 2 to 100 characters (ER0007). The wider 200-character ceiling on title_pattern lets you paste a longer substring when you need it.

Do these parameters expand synonyms and word forms?

Yes. Like the plain title filter, all three refining parameters pass your term through APITube’s query expansion (synonyms and morphological forms) before matching. Each expanded variant is combined with OR, so the request matches headlines containing any form of the term, not only the exact spelling you typed. This means a single title_pattern can quietly match several related spellings — useful for recall, but another reason to keep the term specific when you want precision.

You can combine these parameters with each other and with any other filter (language, date, source, category) in the same request — the title conditions are added on top of the rest of your query. For the full list of accepted parameters and values, see the official parameters reference.

Common Questions

Which parameter should I use to match part of a word?

Use title_pattern. It performs a substring match (LIKE '%term%'), so it matches the term anywhere inside the headline, including inside a longer word. The plain title search matches whole words only, and title_starts_with / title_ends_with anchor to the start or end of the entire title, so none of those will match a fragment in the middle of a word the way title_pattern does.

Are title_starts_with and title_ends_with case-sensitive?

No. Both convert the headline to lowercase before testing the prefix or suffix, so title_starts_with=apple and title_starts_with=Apple return the same results. The match is anchored to the whole title string: title_starts_with checks the first characters of the headline, and title_ends_with checks the last characters.

Why did my title refinement return a 400 error?

The value was out of its allowed length range. title_starts_with and title_ends_with accept 2 to 100 characters (ER0009 / ER0010), and title_pattern accepts 2 to 200 characters (ER0011). The most common cause is passing a single character — every refining parameter requires at least two.

Yes. You can send title, title_starts_with, title_ends_with and title_pattern together, and mix them with any other filter. Each adds its own condition to the query, so the result must satisfy all of them at once. For exact multi-word matching, see how to search for an exact phrase using quotes in the title parameter.


Related Articles