> ## Documentation Index
> Fetch the complete documentation index at: https://docs.forestreet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Attributes

> This endpoint retrieves all the headquarter countries, NAICS codes and diversity certifications identified in the given market after the given filter was applied.<br /><br />
This is commonly used to build a Filter functionality on a UI, allowing the user to dynamically see the applicable filters as more and more requirements are added; but it can also be used to query the attributes for a subset of companies.

### Path

<ParamField path="marketId" type="string" initialValue="2">
  The ID of the market which you want to retrieve countries of. This can be retrieved by searching for markets.
</ParamField>

### Body Request Object Example

This endpoint is typically called once with only the `marketId` without any filters first to know all the possible
literal values to filter by. Then when the user selects the desired attributes, subsequent calls can be filtered by a
relevant `POST` body JSON.

Using all the possible keys:

```JSON theme={null}
{
    "domains": ["ibm.com", "otter.ai"],
    "hqCountries": ["United States", "United Kingdom"],
    "operatesIn": [
        {
            "country": "France"
        },
        {
            "country": "Germany"
        }
    ]
    "naics": [334400, 541000],
    "diversityCertifications": [
        "Disabled Veteran Business Enterprise",
        "People With Disability"
    ]
}
```

### Body

<ParamField body="domains" type="string[]">
  If specified, return only attributes of companies matching the given domains.
</ParamField>

<ParamField body="hqCountries" type="string[]">
  If specified, return only attributes of companies with headquarters matching any of the given countries.

  The special value of `'(No Data)'` is a valid input here, for any companies that do not have their HQ country
  registered.
</ParamField>

<ParamField body="operatesIn" type="array">
  If specified, return only companies which had recently operated in any of the given locations.

  <Expandable title="location">
    <ParamField body="country" type="string">
      The country of this location.

      The exact allowed values can be found by querying this endpoint without any filters first.
    </ParamField>

    <ParamField body="state" type="string">
      The state of this location.

      <Warning>Support for this field is experimental - the results returned could be inaccurate or not up to date.</Warning>
    </ParamField>

    <ParamField body="city" type="string">
      The city of this location.

      <Warning>Support for this field is experimental - the results returned could be inaccurate or not up to date.</Warning>
    </ParamField>

    <ParamField body="postcode" type="string">
      The postcode of this location.

      <Warning>Support for this field is experimental - the results returned could be inaccurate or not up to date.</Warning>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="naics" type="integer[]">
  If specified, return only attributes of companies matching any of the given NAICS codes.

  If a parent NAICS node is specified, all children nodes are automatically included.
</ParamField>

<ParamField body="diversityCertifications" type="string[]">
  If specified, return only attributes of companies matching any of the given diversity certifications.

  The special value of `'(No Certifications)'` is a valid input here, for any companies that do not have any diversity
  certifications.

  Use this endpoint without a `diversityCertifications` filter to check the valid values.
</ParamField>

### Response

<ResponseField name="meta" type="object">
  Metadata summarizing the `data` returned.

  <Expandable title="meta">
    <ResponseField name="totalItems" type="number">
      The number of unique country names found in the study.
    </ResponseField>

    <ResponseField name="totalUniqueCompanies" type="number">
      The number of unique companies headquartered in any of the above countries.

      This does not count companies in the market for which the headquarter country
      could not be determined.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="data" type="object">
  The attributes associated with the filtered companies.

  <Expandable title="meta">
    <ResponseField name="countries" type="object">
      A mapping of all countries to their number of occurrences, sorted by

      * descending number of occurrences, and then
      * alphabetical order of the countries.
    </ResponseField>

    <ResponseField name="operatesIn" type="array">
      An array of objects, each representing a location where companies in the study had recently
      operated in, together with the number of companies that did so.

      <Expandable title="locationCount">
        Currently only the country is supported as a location.

        <ResponseField name="country" type="string">
          The country of this location.
        </ResponseField>

        <ResponseField name="count" type="number">
          The number of companies in the study that had recently operated in this location.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="naics" type="object">
      A tree of all NAICS codes mapped to their number of occurrences, nested by
      level. The first level is always an array of the top-level NAICS nodes, which in turn
      may have children nodes.

      <Expandable title="node">
        Each node is an object with the following fields:

        <ResponseField name="code" type="number">
          The NAICS code of this node. This should be unique in the tree, and only
          attached to a parent node which has a code that is a prefix of this code.

          For example, if a node has a code of `222100`, it should only be a child of
          a node with a code of `222000`.
        </ResponseField>

        <ResponseField name="name" type="string">
          The name of this NAICS code. This is only provided for reference, as different
          countries are allowed to have different names for the same code, as is typical
          for the deepest level nodes of "National Industries".

          Since a market may contain companies from multiple countries, this field may
          contain the name as defined by any of the relevant countries.
        </ResponseField>

        <ResponseField name="count" type="number">
          **Optional**. The number of companies in the study that are mapped to this NAICS code.
        </ResponseField>

        <ResponseField name="children" type="object[]">
          **Optional**. An array of child nodes, each following the same structure as this node.

          If there are no children, this field will not be present.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="diversityCertifications" type="object">
      A mapping of all certifications to their number of occurrences, sorted by

      * descending number of occurrences, and then
      * alphabetical order of the certification.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
    "meta": {
        "totalItems": 27,
        "totalUniqueCompanies": 27
    },
    "currentQuery": {
        "marketId": 2,
        "countries": [
            "United Kingdom",
            "United States"
        ],
        "operatesIn": [
            {
                "country": "France"
            },
            {
                "country": "Germany"
            }
        ]
    },
    "data": {
        "countries": {
            "United States": 26,
            "United Kingdom": 1
        },
        "operatesIn": [
            {
                "country": "United States",
                "count": 27
            },
            {
                "country": "France",
                "count": 22
            },
            {
                "country": "United Kingdom",
                "count": 17
            },
            {
                "country": "Germany",
                "count": 13
            },
            {
                "country": "Canada",
                "count": 12
            },
            {
                "country": "India",
                "count": 12
            },
            {
                "country": "Italy",
                "count": 9
            },
            {
                "country": "Brazil",
                "count": 9
            },
            {
                "country": "Australia",
                "count": 8
            },
            {
                "country": "Singapore",
                "count": 7
            },
            {
                "country": "Norway",
                "count": 7
            },
            {
                "country": "Argentina",
                "count": 6
            },
            {
                "country": "Spain",
                "count": 6
            },
            {
                "country": "Hungary",
                "count": 5
            },
            {
                "country": "Israel",
                "count": 5
            },
            {
                "country": "Republic of Ireland",
                "count": 5
            },
            {
                "country": "Belgium",
                "count": 5
            },
            {
                "country": "Japan",
                "count": 5
            },
            {
                "country": "Mexico",
                "count": 5
            },
            {
                "country": "Netherlands",
                "count": 5
            },
            {
                "country": "Romania",
                "count": 5
            },
            {
                "country": "China",
                "count": 4
            },
            {
                "country": "Saudi Arabia",
                "count": 4
            },
            {
                "country": "Thailand",
                "count": 4
            },
            {
                "country": "South Africa",
                "count": 4
            },
            {
                "country": "Chile",
                "count": 4
            },
            {
                "country": "Switzerland",
                "count": 4
            },
            {
                "country": "Colombia",
                "count": 3
            },
            {
                "country": "Sweden",
                "count": 3
            },
            {
                "country": "South Korea",
                "count": 3
            },
            {
                "country": "Malaysia",
                "count": 3
            },
            {
                "country": "Egypt",
                "count": 3
            },
            {
                "country": "Indonesia",
                "count": 3
            },
            {
                "country": "Russia",
                "count": 3
            },
            {
                "country": "Philippines",
                "count": 2
            },
            {
                "country": "United Arab Emirates",
                "count": 2
            },
            {
                "country": "Uruguay",
                "count": 2
            },
            {
                "country": "Tunisia",
                "count": 2
            },
            {
                "country": "Croatia",
                "count": 2
            },
            {
                "country": "New Zealand",
                "count": 2
            },
            {
                "country": "Poland",
                "count": 2
            },
            {
                "country": "Latvia",
                "count": 2
            },
            {
                "country": "Pakistan",
                "count": 2
            },
            {
                "country": "Cyprus",
                "count": 2
            },
            {
                "country": "Portugal",
                "count": 2
            },
            {
                "country": "Turkey",
                "count": 2
            },
            {
                "country": "Ukraine",
                "count": 2
            },
            {
                "country": "Cuba",
                "count": 1
            },
            {
                "country": "Mozambique",
                "count": 1
            },
            {
                "country": "Senegal",
                "count": 1
            },
            {
                "country": "Nigeria",
                "count": 1
            },
            {
                "country": "Czech Republic",
                "count": 1
            },
            {
                "country": "Kuwait",
                "count": 1
            },
            {
                "country": "Slovakia",
                "count": 1
            },
            {
                "country": "Guatemala",
                "count": 1
            },
            {
                "country": "Bosnia and Herzegovina",
                "count": 1
            },
            {
                "country": "Georgia",
                "count": 1
            },
            {
                "country": "Iceland",
                "count": 1
            },
            {
                "country": "Austria",
                "count": 1
            },
            {
                "country": "Bangladesh",
                "count": 1
            },
            {
                "country": "Costa Rica",
                "count": 1
            },
            {
                "country": "Denmark",
                "count": 1
            },
            {
                "country": "Finland",
                "count": 1
            },
            {
                "country": "Hong Kong",
                "count": 1
            },
            {
                "country": "Ivory Coast",
                "count": 1
            },
            {
                "country": "Peru",
                "count": 1
            },
            {
                "country": "Sri Lanka",
                "count": 1
            },
            {
                "country": "Vietnam",
                "count": 1
            },
            {
                "country": "Bolivia",
                "count": 1
            },
            {
                "country": "Iraq",
                "count": 1
            },
            {
                "country": "Paraguay",
                "count": 1
            },
            {
                "country": "Serbia",
                "count": 1
            },
            {
                "country": "Syria",
                "count": 1
            },
            {
                "country": "Ecuador",
                "count": 1
            },
            {
                "country": "Honduras",
                "count": 1
            },
            {
                "country": "Taiwan",
                "count": 1
            }
        ],
        "naicsTree": [
            {
                "code": 330000,
                "name": "Manufacturing",
                "count": 13,
                "children": [
                    {
                        "code": 334000,
                        "name": "Computer and Electronic Product Manufacturing",
                        "count": 13,
                        "children": [
                            {
                                "code": 334100,
                                "name": "Computer and Peripheral Equipment Manufacturing",
                                "count": 8,
                                "children": [
                                    {
                                        "code": 334110,
                                        "name": "Computer and Peripheral Equipment Manufacturing",
                                        "count": 8,
                                        "children": [
                                            {
                                                "code": 334112,
                                                "name": "Computer Storage Device Manufacturing",
                                                "count": 2
                                            },
                                            {
                                                "code": 334118,
                                                "name": "Computer Terminal and Other Computer Peripheral Equipment Manufacturing",
                                                "count": 1
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "code": 334200,
                                "name": "Communications Equipment Manufacturing",
                                "count": 1,
                                "children": [
                                    {
                                        "code": 334210,
                                        "name": "Telephone Apparatus Manufacturing",
                                        "count": 1
                                    }
                                ]
                            },
                            {
                                "code": 334400,
                                "name": "Semiconductor and Other Electronic Component Manufacturing",
                                "count": 2,
                                "children": [
                                    {
                                        "code": 334410,
                                        "name": "Semiconductor and Other Electronic Component Manufacturing",
                                        "count": 2,
                                        "children": [
                                            {
                                                "code": 334418,
                                                "name": "Printed Circuit Assembly (Electronic Assembly) Manufacturing",
                                                "count": 1
                                            },
                                            {
                                                "code": 334419,
                                                "name": "Other Electronic Component Manufacturing",
                                                "count": 1
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "code": 334600,
                                "name": "Manufacturing and Reproducing Magnetic and Optical Media",
                                "count": 9,
                                "children": [
                                    {
                                        "code": 334610,
                                        "name": "Manufacturing and Reproducing Magnetic and Optical Media",
                                        "count": 9
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "code": 335000,
                        "name": "Electrical Equipment, Appliance, and Component Manufacturing",
                        "count": 3
                    }
                ]
            },
            {
                "code": 440000,
                "name": "Retail Trade",
                "count": 3,
                "children": [
                    {
                        "code": 449000,
                        "name": "Furniture, Home Furnishings, Electronics, and Appliance Retailers",
                        "count": 3,
                        "children": [
                            {
                                "code": 449200,
                                "name": "Electronics and Appliance Retailers",
                                "count": 3,
                                "children": [
                                    {
                                        "code": 449210,
                                        "name": "Electronics and Appliance Retailers",
                                        "count": 3
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            {
                "code": 510000,
                "name": "Information",
                "count": 27,
                "children": [
                    {
                        "code": 513000,
                        "name": "Publishing Industries",
                        "count": 27,
                        "children": [
                            {
                                "code": 513200,
                                "name": "Software Publishers",
                                "count": 27,
                                "children": [
                                    {
                                        "code": 513210,
                                        "name": "Software Publishers",
                                        "count": 27
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "code": 517000,
                        "name": "Telecommunications",
                        "count": 1,
                        "children": [
                            {
                                "code": 517100,
                                "name": "Wired and Wireless Telecommunications (except Satellite)",
                                "count": 1,
                                "children": [
                                    {
                                        "code": 517110,
                                        "name": "Wired and Wireless Telecommunications Carriers (except Satellite)",
                                        "count": 1,
                                        "children": [
                                            {
                                                "code": 517112,
                                                "name": "Wireless Telecommunications Carriers (except Satellite)",
                                                "count": 1
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "code": 518000,
                        "name": "Computing Infrastructure Providers, Data Processing, Web Hosting, and Related Services",
                        "count": 12,
                        "children": [
                            {
                                "code": 518200,
                                "name": "Computing Infrastructure Providers, Data Processing, Web Hosting, and Related Services",
                                "count": 12,
                                "children": [
                                    {
                                        "code": 518210,
                                        "name": "Computing Infrastructure Providers, Data Processing, Web Hosting, and Related Services",
                                        "count": 12
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            {
                "code": 540000,
                "name": "Professional, Scientific, and Technical Services",
                "count": 22,
                "children": [
                    {
                        "code": 541000,
                        "name": "Professional, Scientific, and Technical Services",
                        "count": 22,
                        "children": [
                            {
                                "code": 541500,
                                "name": "Computer Systems Design and Related Services",
                                "count": 19,
                                "children": [
                                    {
                                        "code": 541510,
                                        "name": "Computer Systems Design and Related Services",
                                        "count": 19,
                                        "children": [
                                            {
                                                "code": 541511,
                                                "name": "Custom Computer Programming Services",
                                                "count": 19
                                            },
                                            {
                                                "code": 541512,
                                                "name": "Computer Systems Design Services",
                                                "count": 1
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "code": 541600,
                                "name": "Management, Scientific, and Technical Consulting Services",
                                "count": 4,
                                "children": [
                                    {
                                        "code": 541610,
                                        "name": "Management Consulting Services",
                                        "count": 4,
                                        "children": [
                                            {
                                                "code": 541611,
                                                "name": "Administrative Management and General Management Consulting Services",
                                                "count": 1
                                            },
                                            {
                                                "code": 541613,
                                                "name": "Marketing Consulting Services",
                                                "count": 2
                                            },
                                            {
                                                "code": 541618,
                                                "name": "Other Management Consulting Services",
                                                "count": 1
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            {
                "code": 560000,
                "name": "Administrative and Support and Waste Management and Remediation Services",
                "count": 2,
                "children": [
                    {
                        "code": 561000,
                        "name": "Administrative and Support Services",
                        "count": 2,
                        "children": [
                            {
                                "code": 561600,
                                "name": "Investigation and Security Services",
                                "count": 2,
                                "children": [
                                    {
                                        "code": 561620,
                                        "name": "Security Systems Services",
                                        "count": 2,
                                        "children": [
                                            {
                                                "code": 561621,
                                                "name": "Security Systems Services (except Locksmiths)",
                                                "count": 2
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            {
                "code": 810000,
                "name": "Other Services (except Public Administration)",
                "count": 1,
                "children": [
                    {
                        "code": 813000,
                        "name": "Religious, Grantmaking, Civic, Professional, and Similar Organizations",
                        "count": 1,
                        "children": [
                            {
                                "code": 813300,
                                "name": "Social Advocacy Organizations",
                                "count": 1,
                                "children": [
                                    {
                                        "code": 813310,
                                        "name": "Social Advocacy Organizations",
                                        "count": 1,
                                        "children": [
                                            {
                                                "code": 813319,
                                                "name": "Other Social Advocacy Organizations",
                                                "count": 1
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ],
        "diversityCertifications": {
            "(No Certifications)": 26,
            "Small Business Enterprise": 1
        }
    }
  ```
</ResponseExample>
