{"id":10409,"date":"2024-10-18T10:19:20","date_gmt":"2024-10-18T09:19:20","guid":{"rendered":"https:\/\/www.verificaremails.com\/api-to-extract-the-name-and-surname-from-a-mail-or-string\/"},"modified":"2024-10-18T10:21:18","modified_gmt":"2024-10-18T09:21:18","slug":"api-to-extract-the-name-and-surname-from-a-mail-or-string","status":"publish","type":"post","link":"https:\/\/www.verificaremails.com\/en\/api-to-extract-the-name-and-surname-from-a-mail-or-string\/","title":{"rendered":"API to extract the name and surname from a mail or string"},"content":{"rendered":"<p>We have just released an extension of our <a href=\"https:\/\/www.verificaremails.com\/validar-nombres\/\">API to verify names<\/a>. The purpose of this API is to extract the first and\/or last name from an email or any string. I will give you a practical example to understand its usefulness. Let&#8217;s imagine that we have the email of a customer, but at the time of registration we do not ask for the first and last name. It is common, especially in corporate email addresses, that the full name or part of it form the suffix of the email. This would be the text in front of the &#8220;@&#8221; character. Ex: a.pous@gmail.com corresponds to a user with the surname Pous Ex: antxon.pous@gmail.com would correspond to a user with the name Antxon and the surname Pous Ex: antxon_p@gmail.com would correspond to a user with the name Antxon. All this information can be obtained accurately with the API extraction of names and surnames. Apart from extracting the identity, the API also allows us to know the sex of the person by analyzing the name and to know its origin, since we can know in which countries that name is most used. In the image below you can see all the information we extract from the email &#8220;antxon.pous@gmail.com&#8221;. <\/p>\n<p><img fetchpriority=\"high\"  decoding=\"async\" class=\"alignnone size-full wp-image-10402\" src=\"https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/json_api_extraccion_nombres.webp\" alt=\"JSON API name extraction\" width=\"1651\" height=\"863\" srcset=\"https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/json_api_extraccion_nombres.webp 1651w, https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/json_api_extraccion_nombres-300x157.webp 300w, https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/json_api_extraccion_nombres-1024x535.webp 1024w, https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/json_api_extraccion_nombres-768x401.webp 768w, https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/json_api_extraccion_nombres-1536x803.webp 1536w\" sizes=\"(max-width: 1651px) 100vw, 1651px\" \/><\/p>\n<div class=\"mb-md\">\n<div class=\"relative default font-sans text-base text-textMain dark:text-textMainDark selection:bg-super\/50 selection:text-textMain dark:selection:bg-superDuper\/10 dark:selection:text-superDark\">\n<div class=\"min-w-0 break-words [word-break:break-word]\">\n<div dir=\"auto\">\n<div class=\"prose dark:prose-invert inline leading-normal break-words min-w-0 [word-break:break-word]\">\n<p>The Verificaremails API for extracting first and last names from strings is defined as follows:<\/p>\n<h2 class=\"mb-2 mt-6 text-lg first:mt-3\">Endpoint and Method<\/h2>\n<p>The endpoint uses the <a href=\"https:\/\/es.wikipedia.org\/wiki\/API\" target=\"_blank\" rel=\"nofollow noopener\">POST method<\/a> and the URL is https:\/\/api.verificarnombres.com\/split. <\/p>\n<\/div>\n<div class=\"prose dark:prose-invert inline leading-normal break-words min-w-0 [word-break:break-word]\">\n<h2><img  decoding=\"async\" class=\"size-full wp-image-10398 aligncenter\" src=\"https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/api_extraccion_nombres-scaled.webp\" alt=\"API extraction names\" width=\"2560\" height=\"813\" srcset=\"https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/api_extraccion_nombres-scaled.webp 1920w, https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/api_extraccion_nombres-300x95.webp 300w, https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/api_extraccion_nombres-1024x325.webp 1024w, https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/api_extraccion_nombres-768x244.webp 768w, https:\/\/www.verificaremails.com\/wp-content\/uploads\/2024\/10\/api_extraccion_nombres-1536x488.webp 1536w\" sizes=\"(max-width: 2560px) 100vw, 2560px\" \/><\/h2>\n<h2 class=\"mb-2 mt-6 text-lg first:mt-3\">Operation<\/h2>\n<p>This API is designed to parse a text string and extract possible first and last names from it. It is especially useful for processing unstructured data and obtaining contact information in an automated way. <\/p>\n<h2 class=\"mb-2 mt-6 text-lg first:mt-3\">Input Parameters<\/h2>\n<p>The API requires the following parameter in the request body:<\/p>\n<ul class=\"marker:text-textOff list-disc pl-8\">\n<li><strong>text<\/strong>: The text string from which you want to extract the names and surnames.<\/li>\n<\/ul>\n<h2 class=\"mb-2 mt-6 text-lg first:mt-3\">Reply<\/h2>\n<p>The API returns a JSON response with the following information:<\/p>\n<ul class=\"marker:text-textOff list-disc pl-8\">\n<li><strong>name<\/strong>: The name extracted from the text.<\/li>\n<li><strong>surname<\/strong>: The last name taken from the text.<\/li>\n<li><strong>full_name<\/strong>: The full name extracted, combining first and last name.<\/li>\n<\/ul>\n<div>\n<blockquote>\n<div>{<\/div>\n<div>  &#8220;status&#8221;: true,<\/div>\n<div>  &#8220;message&#8221;: {<\/div>\n<div>  &#8220;result&#8221;: {<\/div>\n<div>  &#8220;first_name&#8221;: {<\/div>\n<div>  &#8220;country&#8221;: {<\/div>\n<div>  &#8220;Bolivia, Plurinational State of&#8221;: 0.004,<\/div>\n<div>  &#8220;Spain&#8221;: 0.939,<\/div>\n<div>  &#8220;France&#8221;: 0.026,<\/div>\n<div>  &#8220;Italy&#8221;: 0.013,<\/div>\n<div>  &#8220;Mexico&#8221;: 0.009,<\/div>\n<div>  &#8220;United States&#8221;: 0.009<\/div>\n<div>  },<\/div>\n<div>  &#8220;gender&#8221;: {<\/div>\n<div>  &#8220;Female&#8221;: 0.009,<\/div>\n<div>  &#8220;Male&#8221;: 0.991<\/div>\n<div>  },<\/div>\n<div>  &#8220;rank&#8221;: {<\/div>\n<div>  &#8220;Spain&#8221;: 2534,<\/div>\n<div>  &#8220;Bolivia, Plurinational State of&#8221;: null,<\/div>\n<div>  &#8220;France&#8221;: null,<\/div>\n<div>  &#8220;Italy&#8221;: null,<\/div>\n<div>  &#8220;Mexico&#8221;: null,<\/div>\n<div>  &#8220;United States&#8221;: null<\/div>\n<div>  },<\/div>\n<div>  &#8220;name&#8221;: &#8220;Antxon&#8221;.<\/div>\n<div>  },<\/div>\n<div>  &#8220;last_name&#8221;: {<\/div>\n<div>  &#8220;country&#8221;: {<\/div>\n<div>  &#8220;Canada&#8221;: 0.007,<\/div>\n<div>  &#8220;Switzerland&#8221;: 0.014,<\/div>\n<div>  &#8220;Chile&#8221;: 0.01,<\/div>\n<div>  &#8220;Algeria&#8221;: 0.071,<\/div>\n<div>  &#8220;Spain&#8221;: 0.378,<\/div>\n<div>  &#8220;France&#8221;: 0.429,<\/div>\n<div>  &#8220;Italy&#8221;: 0.01,<\/div>\n<div>  &#8220;Morocco&#8221;: 0.01,<\/div>\n<div>  &#8220;Mexico&#8221;: 0.024, &#8220;United<\/div>\n<div>States&#8221;: 0.047}, &#8220;gender&#8221;: {}, &#8220;rank&#8221;: {&#8220;Spain&#8221;: 6987, &#8220;Canada&#8221;: null, &#8220;Switzerland&#8221;: null, &#8220;Chile&#8221;: null, &#8220;Algeria&#8221;:<\/div>\n<div>null,<\/div>\n<div>  &#8220;France&#8221;: null,<\/div>\n<div>  &#8220;Italy&#8221;: null,<\/div>\n<div>  &#8220;Morocco&#8221;: null,<\/div>\n<div>  &#8220;Mexico&#8221;: null,<\/div>\n<div>  &#8220;United States&#8221;: null<\/div>\n<div>  },<\/div>\n<div>  &#8220;name&#8221;: &#8220;Pous&#8221;<\/div>\n<div>  },<\/div>\n<div>  &#8220;last_name2&#8221;: null<\/div>\n<div>  }<\/div>\n<div>  }<\/div>\n<div>}<\/div>\n<\/blockquote>\n<\/div>\n<h2 class=\"mb-2 mt-6 text-lg first:mt-3\">Practical Use<\/h2>\n<p>This API is particularly useful in scenarios such as:<\/p>\n<ul class=\"marker:text-textOff list-disc pl-8\">\n<li>Processing of e-mails or documents to extract contact information.<\/li>\n<li>Analysis of unstructured databases to obtain names of individuals.<\/li>\n<li>Automation of data entry tasks in CRM or similar systems.<\/li>\n<\/ul>\n<p>The ability to extract first and last names from text strings allows companies and developers to improve efficiency in personal data handling and contact management.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div>If you wish to evaluate the API you can contact us via chat and we will provide you with access. I hope you like it \ud83d\ude09<\/div>\n","protected":false},"excerpt":{"rendered":"<p>We have just released an extension of our API to verify names. The purpose of this API is to extract the first and\/or last name from an email or any string. I will give you a practical example to understand its usefulness. Let&#8217;s imagine that we have the email of a customer, but at the &#8230; <a title=\"API to extract the name and surname from a mail or string\" class=\"read-more\" href=\"https:\/\/www.verificaremails.com\/en\/api-to-extract-the-name-and-surname-from-a-mail-or-string\/\" aria-label=\"Read more about API to extract the name and surname from a mail or string\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":10403,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1134],"tags":[],"class_list":["post-10409","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-validate-names-and-surnames"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.verificaremails.com\/en\/wp-json\/wp\/v2\/posts\/10409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.verificaremails.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.verificaremails.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.verificaremails.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.verificaremails.com\/en\/wp-json\/wp\/v2\/comments?post=10409"}],"version-history":[{"count":0,"href":"https:\/\/www.verificaremails.com\/en\/wp-json\/wp\/v2\/posts\/10409\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.verificaremails.com\/en\/wp-json\/wp\/v2\/media\/10403"}],"wp:attachment":[{"href":"https:\/\/www.verificaremails.com\/en\/wp-json\/wp\/v2\/media?parent=10409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.verificaremails.com\/en\/wp-json\/wp\/v2\/categories?post=10409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.verificaremails.com\/en\/wp-json\/wp\/v2\/tags?post=10409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}