Related Tags API

Created by Iago Fernández · last update December 10, 2019

About this endpoint

The Related Tags endpoint will return suggestion that include terms from the initial query.

GET
https://api.empathybroker.com/search/v1/query/{instance_id}/relatedtags?{Input_Parameters}

Input Parameters

Parameter Data Type
q String
lang String

Implementation

Theres a simple implementation in java to consume this endpoint.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Client client;
WebTarget target;
public void init(){
    client = ClientBuilder.newClient();
    target = client.target("https://api.empathybroker.com/search/v1/query/{instance_id}/relatedtags")
        //Query parameters
        .queryParam("lang","ES")

   
}
 
public JSON getResponse(String query){
    return target.queryParam("q",query).request(MediaType.APPLICATION_JSON).get(JSON.class)
}

Output

The will return a Json node with the related tags for the query

1
2
3
4
5
6
7
8
9
10
[
    {
        tag: "ZZZZZZ",
        query: "BBB ZZZ"
    },
    {
        tag: "YYYYY",
        query: "YYYY BBBB"
    }
]