Filter Segments with OR Logic Using the Label API

By Edouard on October 3, 2025

We’re excited to announce a powerful enhancement to our API label filtering system that makes it easier than ever to work with segments across multiple categories.

What’s New?

You can now use OR logic when filtering segments by labels in the WebTranslateIt API. This means you can retrieve segments that match any of the specified labels, not just those that match all of them.

How It Works

The Syntax

Use the |[label1,label2,label3] syntax to filter segments with OR logic:

GET /api/projects/:project_api_key/strings.json?filters[label]=|[bug-fix,new-feature]

This returns all segments labeled with either “bug-fix” OR “new-feature”.

Real-World Example

Let’s say you’re managing a large localization project and you want to export all segments that need urgent attention. You’ve been using labels to categorize your work:

  • high-priority for critical segments
  • bug-fix for corrections
  • release-blocker for segments that must be translated before launch

Previously, you would need to make three separate API calls to fetch each category. Now, you can get them all in one request:

curl "https://webtranslateit.com/api/projects/YOUR_API_KEY/strings.json?filters[label]=|[high-priority,bug-fix,release-blocker]"

Complete Label Filtering Options

WebTranslateIt now supports three different label filtering modes:

1. Single Label Match (default)

filters[label]=urgent

Returns segments with the “urgent” label.

2. OR Logic (any of the labels)

filters[label]=|[label1,label2,label3]

Returns segments with any of the specified labels.

3. AND Logic (all of the labels)

filters[label]=[label1,label2,label3]

Returns segments with all of the specified labels.

4. Negative Matching (exclude a label)

filters[label]=!unwanted

Returns segments that do not have the “unwanted” label.

5. No Labels

filters[label]=none

Returns segments with no labels at all.

URL Encoding

Remember to URL-encode your labels when making API requests. Spaces should be encoded as + or %20, and special characters must be properly escaped:

filters[label]=|[new+feature,bug+fix,ui+improvement]

Use Cases

This feature is particularly useful for:

  • Batch exports: Download all segments from multiple related categories at once
  • Priority filtering: Combine different priority levels (critical, high, medium) in one query
  • Feature-based filtering: Get all segments related to multiple features (checkout, payments, shipping)
  • Status tracking: Filter by multiple workflow states (needs-review, needs-context, needs-screenshot)
  • Release management: Gather segments for multiple upcoming releases

Integration with Existing Workflows

This enhancement works seamlessly with all other API filters. You can combine OR logic with:

  • Status filters (filters[status]=to_translate)
  • File filters (filters[file]=123)
  • Category filters (filters[category]=mobile)
  • Date range filters (filters[created_at]=2025-10-01)
  • Type filters (filters[type]=string)

Example combining multiple filters:

curl "https://webtranslateit.com/api/projects/YOUR_API_KEY/strings.json?filters[label]=|[urgent,high-priority]&filters[status]=to_translate&filters[locale]=fr"

This returns all French segments that are untranslated and marked as either “urgent” OR “high-priority”.

Documentation

For complete API documentation, including all available filters and parameters, visit:

API String Documentation

You can also learn more about label filtering in our FAQ:

Searching for segments with multiple labels

Getting Started

This feature is available immediately in the API for all WebTranslateIt plans. No changes are required to your existing integrations—OR logic is a new syntax option that works alongside your current label filtering.

Try it out and let us know how it improves your workflow! If you have questions or feedback, reach out to us at support@webtranslateit.com.


Technical Details:

  • Label matching is case-sensitive
  • You can include as many labels as needed in the array
  • The feature is available in both the read-only and read-write API endpoints