--- url: "https://web.dev/articles/web-apps/contacts" titulek: "How to access contacts from the address book | Web Apps | web.dev" h1: "How to access contacts from the address book Stay organized with collections Save and categorize content based on your preferences." popis: "" jazyk: "en" kanonicka: "https://web.dev/articles/web-apps/contacts" drobecky: ["Web Apps", "How to access contacts from the address book"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 02:41:31" znaku: 5514 slov: 665 kodovani: "iso-8859-2" sha256: "19a7b89bbf975ac3f85f009f299adbc52fb9753cedd89e1768ccbe2d9526b787" --- How to access contacts from the address book Stay organized with collections Save and categorize content based on your preferences. Thomas Steiner Sometimes you want to let users of your app select one of their contacts to message via an email or chat application, or help them discover which of their contacts have already joined a social platform. The modern way Using the Contact Picker API To get contacts from the address book, you need to use the [Contact Picker API](https://developer.mozilla.org/docs/Web/API/Contact_Picker_API), which allows users to select entries from their contact list and share limited details of the selected entries with your app. Several properties like `name`, `email`, `tel`, `address`, and `icon` are available. To find out about the concretely supported properties, call `navigator.contacts.getProperties()`. To allow the user to select multiple contacts, pass `{multiple: true}` as the second parameter of `navigator.contacts.select()`. Browser Support x x x x [Source](https://developer.mozilla.org/docs/Web/API/ContactsManager) The Contact Picker API is available in the Android version of Chrome from version 80. The classic way Using a regular form The fallback method is to use a regular form that lets the user enter the contact's details. Browser Support 1 12 1 3 [Source](https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/form) Progressive enhancement If the Contact Picker API is supported, hide the static form fields and show a picker button instead. `const button = document.querySelector('button'); const name = document.querySelector('.name'); const address = document.querySelector('.address'); const email = document.querySelector('.email'); const tel = document.querySelector('.tel'); const pre = document.querySelector('pre'); const autofills = document.querySelectorAll('.autofill'); if ('contacts' in navigator) { button.hidden = false; for (const autofill of autofills) { autofill.parentElement.style.display = 'none'; } address.parentElement.style.display = 'block'; button.addEventListener('click', async () => { const props = ['name', 'email', 'tel', 'address']; const opts = { multiple: false }; try { const [contact] = await navigator.contacts.select(props, opts); name.value = contact.name; address.value = contact.address; tel.value = contact.tel; email.value = contact.email; } catch (err) { pre.textContent = `${err.name}: ${err.message}`; } }); }` Further reading [Contact Picker API](https://developer.mozilla.org/docs/Web/API/Contact_Picker_API) [A contact picker for the web](/contact-picker) Demo HTML `
Ship your order as a present to a friend.
` CSS `html { box-sizing: border-box; font-family: system-ui, sans-serif; color-scheme: dark light; } *, *:before, *:after { box-sizing: inherit; } body { margin: 1rem; } input { display: block; margin-block-end: 1rem; }` JS `const button = document.querySelector('button'); const name = document.querySelector('.name') const address = document.querySelector('.address') const email = document.querySelector('.email') const tel = document.querySelector('.tel') const pre = document.querySelector('pre') const autofills = document.querySelectorAll('.autofill') if ('contacts' in navigator) { button.hidden = false; for (const autofill of autofills) { autofill.parentElement.style.display = 'none' } address.parentElement.style.display = 'block'; button.addEventListener('click', async () => { const props = ['name', 'email', 'tel', 'address']; const opts = {multiple: false}; try { const [contact] = await navigator.contacts.select(props, opts); name.value = contact.name; address.value = contact.address; tel.value = contact.tel email.value = contact.email; } catch (err) { pre.textContent = `${err.name}: ${err.message}` } }); }` Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For details, see the [Google Developers Site Policies](https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates. Last updated 2026-09-04 UTC.