> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.zip.tax/v-6-0/guides/rest-api/by-lat-lng/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.zip.tax/_mcp/server. # By Lat / Lng Look up the single sales tax rate that applies at a specific latitude/longitude. The API skips the geocoding step and returns the rate for that exact point. Ideal when you already have verified coordinates from your own address verification pipeline, a map click, a GPS reading, or a storefront's known location. > **Info** > > Lat/lng lookups return the same door-level, adjusted rate as > [By Address](by-address), just without the geocoding. If you only have > a street address, use By Address instead. ## Endpoint ```http GET https://api.zip-tax.com/request/v60 ``` Send the coordinates in the `lat` and `lng` query parameters as decimal degrees. > **Tip** > > Use **at least 5 decimal places** of precision (e.g. `33.65253`, not > `33.65`). Rooftop-level accuracy requires sub-meter precision; truncating > coordinates may land you in a different tax jurisdiction. ## Quick example #### cURL ```bash curl -H "X-API-KEY: YOUR_API_KEY" \ "https://api.zip-tax.com/request/v60?lat=33.65253&lng=-117.74794" ``` #### Python ```python import requests res = requests.get( "https://api.zip-tax.com/request/v60", headers={"X-API-KEY": "YOUR_API_KEY"}, params={"lat": 33.65253, "lng": -117.74794}, ) res.raise_for_status() data = res.json() ``` #### Node.js ```javascript const res = await fetch( "https://api.zip-tax.com/request/v60?" + new URLSearchParams({ lat: 33.65253, lng: -117.74794 }), { headers: { "X-API-KEY": "YOUR_API_KEY" } } ); const data = await res.json(); ``` #### Go ```go import ( "fmt" "net/http" ) u := fmt.Sprintf( "https://api.zip-tax.com/request/v60?lat=%f&lng=%f", 33.65253, -117.74794, ) req, _ := http.NewRequest("GET", u, nil) req.Header.Set("X-API-KEY", "YOUR_API_KEY") res, err := http.DefaultClient.Do(req) ``` ## Parameters ### Required | Parameter | Type | Description | | --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ | | `lat` | number | Latitude in decimal degrees. Use at least 5 decimal places for rooftop accuracy. | | `lng` | number | Longitude in decimal degrees. Use at least 5 decimal places for rooftop accuracy. Negative for locations west of the prime meridian. | Both `lat` and `lng` must be supplied together. You must also authenticate with your API key via the `X-API-KEY` header (recommended) or the `key` query parameter. ### Optional | Parameter | Type | Default | Description | | ---------------- | ------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `format` | string | `json` | Response format. Set to `xml` if you need XML; remember to also set `Content-Type` accordingly. | | `countryCode` | string | `USA` | ISO 3166-1 alpha-3 country code. `USA` (default), `CAN`, or a US territory (`PRI` Puerto Rico, `ASM` American Samoa, `GUM` Guam, `MNP` Northern Mariana Islands, `VIR` U.S. Virgin Islands). US territories are looked up through the US path and need no extra entitlement. Canadian rates require a Pro or Enterprise plan. | | `taxabilityCode` | string | none | Taxability Information Code (TIC) to get product-specific rules in the response. See the [TIC catalog](https://api.zip-tax.com/data/tic). Requires Pro or Enterprise plan. | | `historical` | string | none | Month to fetch historical rates for, in `YYYYMM` format (e.g. `202401` for January 2024). Cannot be the current month or in the future. Requires Pro or Enterprise plan. | > **Warning** > > Plan-gated parameters return a specific response code if your account > doesn't have the entitlement: `countryCode=CAN` returns code **112** > (`rate_loc_can` entitlement), `taxabilityCode` returns code **113** > (`product_rates` entitlement). See the > [Response Codes](../reference/response-codes) reference for the full > list. ## Example response The response shape is identical to the [By Address](by-address#example-response) response: `baseRates`, `taxSummaries`, `sourcingRules`, `addressDetail` (with the reverse-geocoded address), etc. A truncated example: ```json { "metadata": { "version": "v60", "response": { "code": 100, "name": "RESPONSE_CODE_SUCCESS" } }, "taxSummaries": [ { "rate": 0.0775, "taxType": "SALES_TAX", "summaryName": "Total Base Sales Tax" } ], "addressDetail": { "normalizedAddress": "200 Spectrum Center Dr, Irvine, CA 92618-5003, United States", "geoLat": 33.65253, "geoLng": -117.74794 } } ``` ## Tips & common pitfalls #### Precision matters Coordinates truncated to 2 decimal places can drift by more than a kilometer, enough to cross a city or special-district boundary and return the wrong rate. Always pass at least 5 decimal places (≈1 meter resolution). #### Negative longitudes for North America All U.S. and Canadian longitudes are negative (west of the prime meridian). A missing minus sign will either return an error or, if the sign flip lands on a valid location, the wrong rate entirely. #### When to use lat/lng over address Prefer lat/lng when you've already geocoded the address in-house, for fixed points (warehouses, store locations, kiosks), or when working from map clicks and GPS. Prefer [By Address](by-address) when you only have a textual address. Ziptax's geocoder is tuned to tax jurisdictions and does the rooftop adjustment for you. #### Canadian coordinates Set `countryCode=CAN` for coordinates inside Canada. Without the flag, a Canadian lat/lng will fail to match a U.S. jurisdiction and return an error. #### US territory coordinates Set `countryCode` to a US territory code for coordinates inside `PRI` (Puerto Rico), `ASM` (American Samoa), `GUM` (Guam), `MNP` (Northern Mariana Islands), or `VIR` (U.S. Virgin Islands). These are looked up through the US path and need no extra entitlement. ## Related #### [By Address](by-address) Supply a street address instead. Ziptax geocodes for you. #### [By Postal Code](by-postal-code) ZIP-only lookup. Returns all rates that overlap the postal code. #### [API Reference](/api-reference) Full parameter and response schema. > Door-level sales tax rate for a geographic coordinate