ProZ.com global directory of translation services
The translation workplace
Ideas

POST: /term-search

Search the various ProZ.com terms/translations resources. Uses the same backend as ProZ.com Term Search.

Parameters

The POST: /term-search endpoint does not accept any URL or query string parameters, only JSON POST data as described below.

POST data

A JSON object containing a single required and several optional search parameters.

  • query(required)(string): Identical to the ProZ.com Term Search input and uses the same syntax, as described here.
  • resources(optional)(array): An array of strings specifying the ProZ.com terms database resources to search. If not specified, all resources are searched. Possible values:
  • separate_resources(optional)(boolean)(default: false): If true, results will be grouped by resources specified.
  • language_source(optional)(string): Source language code to limit results to.
  • language_target(optional)(string): Target language code to limit results to.
  • profile_languages(optional)(boolean)(LIV-only): If true, search will be limited to language pairs the user has added to their profile. This setting overrides any specified language_source and/or language_target setting.
  • bidirectional(optional)(boolean)(default: false): If true, all reverse language pairs will be searched in addition to the pair(s) specified. This applies to either specification of language_source and/or language_target, or profile_languages.
  • disc_gens(optional)(array): Array of general discipline IDs to limit results to.
  • disc_specs(optional)(array): Array of specific discipline IDs to limit results to.
  • exact_match(optional)(boolean)(default: false): If true, only a string matching the search query exactly will be matched, and the fuzzy_diacritics, match_entire_phrase, and match_whole_words below are all ignored.
  • exact_match_fragments(optional)(boolean)(default: false): If true, an exact match search is performed for each "word" in the query string. Any word which generates search results will be returned as a single element in an array of term_search_result_set objects, instead of just a single term_search_result_set object as with other searches. An example of this nested response is included below. When true, the exact_match, fuzzy_diacritics, match_entire_phrase, and match_whole_words options are all ignored, but any other search option applies to each "word" search. Each fragment must be at least 3 characters long to be looked-up, and also must not appear in a large, multilingual stopwords array (which contains about 9,000 strings as of July 2016.
  • fuzzy_diacritics(optional)(boolean)(default: true): If true, similar characters to those included in the search query will be matched. This is useful for making diacritics such as accents or tildes optional in either the search query or the matched results. See the Elasticseach ASCII folding documentation for more information.
  • match_entire_phrase(optional)(boolean)(default: false): If true, the entered search query is wrapped in double quotes (") so the entire term must be matched exactly. Simply a convenience option; manually wrapping the query in double quotes has the save effect.
  • match_whole_words(optional)(boolean)(default: true): If false, each "token" (or "word") in the search query will have an asterisk (*) appended at the end, achieving a simple form of word stemming.
  • results_start(optional)(int)(default: 0): Where to start in results (for paging).
  • results_per_page(optional)(int)(default: 25): How many results to load per search.

Example request

curl -H 'Content-Type: application/json' \
-H 'Authorization: Bearer OAUTH2_ACCESS_TOKEN' \
-d '{
    "query": "burrito",
    "disc_gens": [8],
    "resources": ["kudoz", "kog"]
}' \
https://api.proz.com/v2/term-search

Response

Nested object containing one or more resource result sets, along with meta information for paging purposes:

{
  "term_search_result_set": [
    {
      "resource": "all",
      "meta": {
        "results_total": 4,
        "result_start": 1,
        "result_end": 4
      },
      "search_results": [
        {
          "id": "3936473",
          "term_source": "cheese bean burrito",
          "term_target": "burrito de queijo e feijão",
          "term_source_highlight": "cheese bean <b>burrito</b>",
          "term_target_highlight": "<b>burrito</b> de queijo e feijão",
          "resource": "kudoz",
          "language_pair": "eng_por",
          "disc_gens": [
            8
          ],
          "disc_specs": [
            28
          ],
          "disc_other": [],
          "web_url": "http://www.proz.com/kudoz/english_to_portuguese/cooking_culinary/3936473-cheese_bean_burrito.html",
          "profile_id_source": 588374,
          "profile_id_target": 1012486,
          "profile_uuid_source": "61eb6ee4-fe39-4db5-aeb5-c16194cb860c",
          "profile_uuid_target": "3574a7ea-3a4b-4305-bb03-3b31f2de77fc",
          "kudoz_link": "https://api.proz.com/v2/kudoz/3936473"
        },
        {
          "id": "3936473",
          "term_source": "cheese bean burrito",
          "term_target": "burrito de queijo e feijão",
          "term_source_highlight": "cheese bean <b>burrito</b>",
          "term_target_highlight": "<b>burrito</b> de queijo e feijão",
          "resource": "kog",
          "language_pair": "eng_por",
          "disc_gens": [
            8
          ],
          "disc_specs": [
            28
          ],
          "disc_other": [],
          "web_url": "http://www.proz.com/kudoz/english_to_portuguese/cooking_culinary/3936473-cheese_bean_burrito.html",
          "profile_id_source": 588374,
          "profile_id_target": 588374,
          "profile_uuid_source": "61eb6ee4-fe39-4db5-aeb5-c16194cb860c",
          "profile_uuid_target": "61eb6ee4-fe39-4db5-aeb5-c16194cb860c",
          "kudoz_link": "https://api.proz.com/v2/kudoz/3936473"
        },
        {
          "id": "204272",
          "term_source": "Carlo is een ezeltje",
          "term_target": "burrito, burro pequeño",
          "term_source_highlight": "Carlo is een ezeltje",
          "term_target_highlight": "<b>burrito</b>, burro pequeño",
          "resource": "kudoz",
          "language_pair": "nld_spa",
          "disc_gens": [
            8
          ],
          "disc_specs": [],
          "disc_other": [],
          "web_url": "http://www.proz.com/kudoz/dutch_to_spanish/other/204272-carlo_is_een_ezeltje.html",
          "profile_id_source": 11,
          "profile_id_target": 10874,
          "profile_uuid_source": null,
          "profile_uuid_target": "1d7dda31-8634-4265-a1b0-9afd183e3224",
          "kudoz_link": "https://api.proz.com/v2/kudoz/204272"
        },
        {
          "id": "103519",
          "term_source": "el burrito grande",
          "term_target": "donkey, Mexican food",
          "term_source_highlight": "el <b>burrito</b> grande",
          "term_target_highlight": "donkey, Mexican food",
          "resource": "kudoz",
          "language_pair": "spa_eng",
          "disc_gens": [
            8
          ],
          "disc_specs": [],
          "disc_other": [],
          "web_url": "http://www.proz.com/kudoz/spanish_to_english/other/103519-el_burrito_grande.html",
          "profile_id_source": 24845,
          "profile_id_target": 4229,
          "profile_uuid_source": "59af0986-bb68-480e-bea1-74bec879253b",
          "profile_uuid_target": "f6bc6fa3-b61a-4666-8fdd-edb6a4212877",
          "kudoz_link": "https://api.proz.com/v2/kudoz/103519"
        }
      ]
    }
  ]
}

When the exact_match_fragments option is true, an array of term_search_result_set objects is returned, instead of a single object, like this:

[
  {
    "term_search_result_set": [
      {
        "resource": "all",
        "meta": {
          "results_total": 166,
          "result_start": 1,
          "result_end": 10
        },
        "search_results": [ ... ]
      }
    ]
  },
  {
    "term_search_result_set": [
      {
        "resource": "all",
        "meta": {
          "results_total": 136,
          "result_start": 1,
          "result_end": 10
        },
        "search_results": [ ... ]
      }
    ]
  },
  {
    "term_search_result_set": [
      {
        ...
      }
    ]
  }
]