Field masks
Field masks allow you to specify which fields you want to include in the response. This can help reduce the amount of data returned and improve performance.
How to use field masks
Section titled “How to use field masks”To use field masks, you can include the fields
query parameter in your API request. The value of this parameter should be a comma-separated list of the fields you want to include in the response.
For example, if you want to include only the ip
,country_code
, and country_name
fields in the response, you can make a request like this:
curl https://api.ip-sonar.com/v1/myip?fields=ip,country_code,country_name
This will return a response that includes only the specified fields:
{ "country_code": "US", "country_name": "United States", "ip": "x.x.x.x"}
Supported fields
Section titled “Supported fields”The following fields are supported for field masks:
accuracy_radius
city_name
continent_code
continent_name
country_code
country_name
ip
is_in_eu
latitude
longitude
postal_code
subdivision_1_code
subdivision_1_name
subdivision_2_code
subdivision_2_name
timezone
Please remember, if you do not specify the fields
parameter, the API will return all available fields by default.