Skip to main content
When working with GWI’s API, the first step is to identify the right question from the available categories and questions. To achieve this efficiently, you can:
  1. Retrieve the full taxonomy from GWI’s API.
  2. Cache the taxonomy locally for quick and repeated access.
  3. Search through the taxonomy to pinpoint the relevant questions.
This use case demonstrates how to navigate GWI’s taxonomy, which is structured hierarchically into categories and questions.

Step 1: Retrieve the Full Taxonomy

To get the entire GWI taxonomy, you can call the /v3/taxonomy endpoint. This endpoint returns all categories, questions, datapoints and suffixes in the structured format of JSON Lines.

Step 2: Cache Locally

Since the GWI taxonomy doesn’t change frequently, caching it locally will significantly improve performance and save repeated API calls. You can store this data into a file for future use with a Python script.

Step 3: Search Questions

To find relevant questions, you can search through the cached taxonomy with keywords (e.g., “social media”). In the given example, the script iterates through all objects in the taxonomy file, i.e., categories, and checks all their child questions’ names and descriptions for the input keyword. Alternatively, feel free to take a look at the dedicated search questions endpoint in API reference.