{"id":18802481,"url":"https://github.com/conveyal/isomorphic-mapzen-search","last_synced_at":"2025-04-13T18:13:18.065Z","repository":{"id":3668305,"uuid":"50416036","full_name":"conveyal/isomorphic-mapzen-search","owner":"conveyal","description":"Isomorphic Mapzen search for reuse across our JavaScript libraries.","archived":false,"fork":false,"pushed_at":"2023-02-03T23:02:20.000Z","size":2876,"stargazers_count":5,"open_issues_count":17,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T08:58:21.958Z","etag":null,"topics":["geocoder","openstreetmap"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/conveyal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-26T08:51:08.000Z","updated_at":"2022-02-03T18:49:21.000Z","dependencies_parsed_at":"2023-02-18T11:50:20.505Z","dependency_job_id":null,"html_url":"https://github.com/conveyal/isomorphic-mapzen-search","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conveyal%2Fisomorphic-mapzen-search","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conveyal%2Fisomorphic-mapzen-search/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conveyal%2Fisomorphic-mapzen-search/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conveyal%2Fisomorphic-mapzen-search/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/conveyal","download_url":"https://codeload.github.com/conveyal/isomorphic-mapzen-search/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248731624,"owners_count":21152835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geocoder","openstreetmap"],"created_at":"2024-11-07T22:28:32.379Z","updated_at":"2025-04-13T18:13:18.041Z","avatar_url":"https://github.com/conveyal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# isomorphic-mapzen-search\n\nIsomorphic Mapzen search for reuse across our JavaScript libraries. As Mapzen has shutdown, please use this library with [Pelias](https://pelias.io/). Coordinates must be anything that can be parsed by [lonlng](https://github.com/conveyal/lonlng).\n\n-   [Examples](#examples)\n-   [API Documentation](#api)\n\n## Examples\n\n### `Autocomplete`\n\n```js\nimport {autocomplete} from 'isomorphic-mapzen-search'\n\nautocomplete({\n  apiKey: MAPZEN_API_KEY,\n  boundary: {\n    country: 'US',\n    rect: {\n      minLon: minLon,\n      minLat: minLat,\n      maxLon: maxLon,\n      maxLat: maxLat\n    }\n  },\n  focusPoint: {lat: 39.7691, lon: -86.1570},\n  layers: 'venue,coarse',\n  text: '1301 U Str'\n}).then((result) =\u003e {\n  console.log(result)\n}).catch((err) =\u003e {\n  console.error(err)\n})\n```\n\n### `search({apiKey, text, ...options})`\n\n```js\nimport {search} from 'isomorphic-mapzen-search'\n\nsearch({\n  apiKey: MAPZEN_API_KEY,\n  text: '1301 U Street NW, Washington, DC',\n  focusPoint: {lat: 39.7691, lon: -86.1570},\n  boundary: {\n    country: 'US',\n    rect: {\n      minLon: minLon,\n      minLat: minLat,\n      maxLon: maxLon,\n      maxLat: maxLat\n    },\n    circle: {\n      centerPoint: centerLonLat,\n      radius: 35 // kilometers\n    }\n  },\n  format: false // keep as returned GeoJSON\n}).then((geojson) =\u003e {\n  console.log(geojson)\n}).catch((err) =\u003e {\n  console.error(err)\n})\n```\n\n### `reverse({apiKey, point, format})`\n\n```js\nimport {reverse} from 'isomorphic-mapzen-search'\n\nreverse({\n  apiKey: MAPZEN_API_KEY,\n  point: {\n    lat: 39.7691,\n    lng: -86.1570\n  },\n  format: true\n}).then((json) =\u003e {\n  console.log(json[0].address)\n}).catch((err) =\u003e {\n  console.error(err)\n})\n```\n\n## API\n\n\u003c!-- Generated by documentation.js. Update this documentation by updating the source code. --\u003e\n\n### autocomplete\n\nSearch for and address using\nMapzen's [Autocomplete](https://mapzen.com/documentation/search/autocomplete/)\nservice.\n\n**Parameters**\n\n-   `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** \n    -   `$0.apiKey` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The Mapzen API key\n    -   `$0.boundary` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** \n    -   `$0.focusPoint` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** \n    -   `$0.format` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n    -   `$0.layers` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** a comma-separated list of\n          [layer types](https://mapzen.com/documentation/search/autocomplete/#layers)\n    -   `$0.options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** options to pass to fetch (e.g., custom headers)\n    -   `$0.sources` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?**  (optional, default `'gn,oa,osm,wof'`)\n    -   `$0.text` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** query text\n    -   `$0.url` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** optional URL to override Mapzen autocomplete endpoint (optional, default `'https://search.mapzen.com/v1/autocomplete'`)\n\nReturns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A Promise that'll get resolved with the autocomplete result\n\n### search\n\nSearch for an address using\nMapzen's [Search](https://mapzen.com/documentation/search/search/)\nservice.\n\n**Parameters**\n\n-   `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** \n    -   `$0.apiKey` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The Mapzen API key\n    -   `$0.boundary` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** \n    -   `$0.focusPoint` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** \n    -   `$0.format` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n    -   `$0.options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** options to pass to fetch (e.g., custom headers)\n    -   `$0.size` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?**  (optional, default `10`)\n    -   `$0.sources` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?**  (optional, default `'gn,oa,osm,wof'`)\n    -   `$0.text` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The address text to query for\n    -   `$0.url` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** optional URL to override Mapzen search endpoint (optional, default `'https://search.mapzen.com/v1/search'`)\n\nReturns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A Promise that'll get resolved with search result\n\n### reverse\n\nReverse geocode using\nMapzen's [Reverse geocoding](https://mapzen.com/documentation/search/reverse/)\nservice.\n\n**Parameters**\n\n-   `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** \n    -   `$0.apiKey` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The Mapzen API key\n    -   `$0.format` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n    -   `$0.options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** options to pass to fetch (e.g., custom headers)\n    -   `$0.point` **{lat: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number), lon: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)}** Point to reverse geocode\n    -   `$0.url` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)?** optional URL to override Mapzen reverse endpoint (optional, default `'https://search.mapzen.com/v1/reverse'`)\n\nReturns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** A Promise that'll get resolved with reverse geocode result\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconveyal%2Fisomorphic-mapzen-search","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconveyal%2Fisomorphic-mapzen-search","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconveyal%2Fisomorphic-mapzen-search/lists"}