opencage-api-client
    Preparing search index...

    Type Alias GeocodingRequest

    GeocodingRequest and related request parameters for the OpenCage API.

    type GeocodingRequest = {
        abbrv?: number;
        add_request?: number;
        address_only?: number;
        bounds?: string;
        countrycode?: string;
        jsonp?: string;
        key?: string;
        language?: string;
        limit?: number;
        min_confidence?: number;
        no_annotations?: number;
        no_dedupe?: number;
        no_record?: number;
        pretty?: number;
        proximity?: string;
        proxyURL?: string;
        q: string;
        roadinfo?: number;
    }
    Index

    Properties

    abbrv?: number

    When set to 1 we attempt to abbreviate and shorten the formatted string we return. Learn more about formatted placename.

    add_request?: number

    When set to 1 the various request parameters are added to the response for ease of debugging.

    address_only?: number

    When set to 1 we include only the address (excluding POI names) in the formatted string we return.

    Example usage: address_only=1

    As an example, by default a reverse geocoding request for the coordinates 50.976004, 11.336753 returns a formatted value of Goethes Gartenhaus, Corona-Schröter-Weg 1, 99425 Weimar, Germany, but if address_only=1 is specified the value would be simply Corona-Schröter-Weg 1, 99425 Weimar, Germany. This can be particularly useful when there are many stores/restaurants/whatever at a single location (for example a multi-story building).

    bounds?: string

    Used only for forward geocoding. This value will restrict the possible results to a defined bounding box. The value of the bounds parameter should be specified as two coordinate points forming the south-west and north-east corners of a bounding box (min lon, min lat, max lon, max lat).

    Example usage: bounds=-0.563160,51.280430,0.278970,51.683979

    countrycode?: string

    Used only for forward geocoding. Restricts results to the specified country/territory or countries.

    Example usage: countrycode=de

    The country code is a two letter code as defined by the ISO 3166-1 Alpha 2 standard. E.g. gb for the United Kingdom, fr for France, us for United States. Non-two letter country codes are ignored. You can specify multiple country codes by supplying a comma separated list. For example countrycode=ca,us would limit results to either the United States or Canada.

    jsonp?: string

    Wraps the returned JSON with a function name.

    key?: string

    a 30 character long, alphanumeric string. The API Key is required when used in a browser. In a Node environment, it is optional, as it will be added automatically from the environment variable OPENAI_API_KEY, and a .env file can also be used.

    language?: string

    An IETF format language code (such as es for Spanish or pt-BR for Brazilian Portuguese), or native in which case we will attempt to return the response in the local language(s).

    Example usage: language=de

    If no language is explicitly specified, we will then look for an HTTP Accept-Language header like those sent by a browser and use highest quality language specified (please see RFC 4647 for details). If the request did not specify a valid header, then en (English) will be assumed.

    limit?: number

    The maximum number of results we should return. Default is 10. Maximum allowable value is 100.

    Example usage: limit=1

    min_confidence?: number

    An integer from 1-10. Only results with at least this confidence will be returned. Learn more about our confidence score on API documentation.

    Example usage: min_confidence=3

    no_annotations?: number

    When set to 1 results will not contain annotations.

    Example usage: no_annotations=1

    The only exception is if the optional roadinfo parameter is set (see below).

    no_dedupe?: number

    When set to 1 results will not be deduplicated.

    no_record?: number

    When set to 1 the query contents are not logged. Please use this parameter if you have concerns about privacy and want us to have no record of your query.

    pretty?: number

    When set to 1 results are 'pretty' printed for easier reading. Useful for debugging.

    proximity?: string

    Used only for forward geocoding. Provides the geocoder with a hint to bias results in favour of those closer to the specified location. Please note though, this is just one of many factors in the internal scoring we use for ranking results. The value is a point with latitude, longitude coordinates in decimal format.

    Example usage: proximity=51.952659,7.632473

    Values that are not valid coordinates are ignored.

    proxyURL?: string

    Use GeocodingOptions.proxyURL instead. The URL of a proxy server to use for the request. This is useful if you want to hide your API Key.

    q: string

    the query string to be geocoded: a latitude, longitude or a place name/address.

    roadinfo?: number

    When set to 1 the behavior of the geocoder is changed to attempt to match the nearest road (as opposed to address). If possible we also fill additional information in the roadinfo annotation. Please see details API Documentation.