The API of DENUE makes it possible to consult data regarding identification, location, economic activity and size of more than 5 million establishments nationwide, by state and municipality. You can use the API to create applications that display information directly from the INEGI databases at the exact moment it is updated.
The INEGI makes the following information, of more than 5 million establishments, available to you.
Welcome to the documentation for developers of the API of DENUE. The INEGI joins the initiative of open access to data with the aim of expanding the availability of information for users.
This documentation is intended for developers familiar with JavaScript programming and with knowledge on object-oriented programming.
Make a query of all establishments that meet the defined conditions.
Input parameters:
Obtain the information of a specific establishment.
Input parameters:
Make a query of all establishments by name or company name and it can be limited to a state.
Input parameters:
Make a query of all establishments and it can be limited to a state.
Input parameters:
Make a query of all establishments with the option to narrow down the search by geographical area, economic activity, name and code of the establishment.
Input parameters:
Make a query of all establishments with the option to narrow down the search by geographical area, economic activity, name, code of the establishment and stratum.
Input parameters:
Count all the establishments with the option to narrow down the search by geographical area, economic activity and stratum.
Input parameters:
To consult the API, the parameters are sent directly to the URL, for example, for the Search method it is done as follows:
These are the data that the previous URL shows:
The order of the return values is explained below:
Field 1: Establishment Id
Field 2: Name of the establishment
Field 3: Company name
Field 4: Class of economic activity
Field 5: Stratum (Employed personnel)
Field 6: Type of road
Field 7: Street
Field 8: Street number
Field 9: Apartment number
Field 10: Neighborhood
Field 11: Zip code
Field 12: Locality, municipality and state
Field 13: Telephone
Field 14: Email
Field 15: Website
Field 16: Type of establishment
Field 17: Longitude
Field 18: Latitude
Field 19: Shopping mall
Field 20: Type of shopping mall
Field 21: Store number
For the Information sheet method it is done as follows:
These are the data that the previous URL shows:
The order of the returned values is explained below:
Field 1: Establishment Id
Field 2: Name of the establishment
Field 3: Company name
Field 4: Class of economic activity
Field 5: Stratum (Employed personnel)
Field 6: Type of road
Field 7: Street
Field 8: Street number
Field 9: Apartment number
Field 10: Neighborhood
Field 11: Zip code
Field 12: Locality, municipality and state
Field 13: Telephone
Field 14: Email
Field 15: Website
Field 16: Type of establishment
Field 17: Longitude
Field 18: Latitude
Field 19: Shopping mall
Field 20: Type of shopping mall
Field 21: Store number
For the Name method it is done as follows:
These are the data that the previous URL shows:
The order of the returned values is explained below:
Field 1: Establishment Id
Field 2: Name of the establishment
Field 3: Company name
Field 4: Class of economic activity
Field 5: Stratum (Employed personnel)
Field 6: Type of road
Field 7: Street
Field 8: Street number
Field 9: Apartment number
Field 10: Neighborhood
Field 11: Zip code
Field 12: Locality, municipality and state
Field 13: Telephone
Field 14: Email
Field 15: Website
Field 16: Type of establishment
Field 17: Longitude
Field 18: Latitude
Field 19: Shopping mall
Field 20: Type of shopping mall
Field 21: Store number
For the BuscarEntidad method it is done as follows:
These are the data that the previous URL shows:
Field 1: Establishment Id
Field 2: Name of the establishment
Field 3: Company name
Field 4: Class of economic activity
Field 5: Stratum (Employed personnel)
Field 6: Type of road
Field 7: Street
Field 8: Street number
Field 9: Apartment number
Field 10: Neighborhood
Field 11: Zip code
Field 12: Locality, municipality and state
Field 13: Telephone
Field 14: Email
Field 15: Website
Field 16: Type of establishment
Field 17: Longitude
Field 18: Latitude
For the BuscarAreaAct method it is done as follows:
These are the data that the previous URL shows:
The order of the return values is listed below:
Field 1: Establishment Id
Field 2: Name of the establishment
Field 3: Company name
Field 4: Class of economic activity
Field 5: Stratum (Employed personnel)
Field 6: Type of road
Field 7: Street
Field 8: Street number
Field 9: Apartment number
Field 10: Neighborhood
Field 11: Zip code
Field 12: Locality, municipality and state
Field 13: Telephone
Field 14: Email
Field 15: Website
Field 16: Type of establishment
Field 17: Longitude
Field 18: Latitude
Field 19: Type of industrial corridor
Field 20: Name of the industrial corridor
Field 21: Premises number
Field 22: Basic Geostatistical Area
Field 23: Block
Field 24: Building
Field 25: Class of economic activity id
Field 26: Sector of economic activity id
Field 27: Subsector of economic activity id
Field 28: Branch of economic activity id
For the BuscarAreaAct method it is done as follows:
These are the data that the previous URL shows:
The order of the return values is listed below:
Field 1: Establishment Id
Field 2: Name of the establishment
Field 3: Company name
Field 4: Class of economic activity
Field 5: Stratum (Employed personnel)
Field 6: Type of road
Field 7: Street
Field 8: Street number
Field 9: Apartment number
Field 10: Neighborhood
Field 11: Zip code
Field 12: Locality, municipality and state
Field 13: Telephone
Field 14: Email
Field 15: Website
Field 16: Type of establishment
Field 17: Longitude
Field 18: Latitude
Field 19: Type of industrial corridor
Field 20: Name of the industrial corridor
Field 21: Premises number
Field 22: Basic Geostatistical Area
Field 23: Block
Field 24: Class of economic activity id
Field 25: Building floor number
Field 26: sector of economic activity id
Field 27: subsector of economic activity id
Field 28: Branch of economic activity id
Field 29: Sub-branch of economic activity id
Field 30: Building
Field 31: Type of settlement
Field 32: Registration date of the establishment
Field 33: Code of the geographical area
For the method to Quantify, it is done as follows:
These are the data that the previous URL shows:
The order of the return values is listed below:
Field 1: Class of economic activity id
Field 2: Code of the geographical area
Field 3: Total establishments by geographical area, economic activity and specified range
<html> <head> <style> body,table{ background-color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 9pt; font-weight: normal; text-decoration: none; color: #000000} </style> <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.2.min.js"></script> <script src="js/apiDenue.js"></script> </head> <body> <div> <div id="tabDenue"></div> <label for="condi">Condition: </label><input style="max-width:120px;" type="text" id="condi" aria-label="Status" value="restaurants" tabindex="515" /> <label for="lat">Latitude: </label><input style="max-width:120px;" type="text" id="lat" aria-label="Latitude" value="21.85717833" tabindex="516" /> <label for="lon">Longitude: </label><input style="max-width:120px;" type="text" id="lon" aria-label="Longitude" value="-102.28487238" tabindex="517" /> <label for="mts">Meters: </label><input style="max-width:120px;" type="text" id="mts" aria-label="Meters" value="200" tabindex="518" /> <input type="button" onclick="llamarApiDenueBus();" value="Ver listado" tabindex="519" aria-label="Ver listado" /> <div> </body> </html>
// Cuando ya tengas tu token reemplaza el texto 'AQUÍ_VA_TU_TOKEN' de la siguiente variable con él. var token = 'AQUÍ_VA_TU_TOKEN'; var urlApiBusqueda = 'https://www.inegi.org.mx/app/api/denue/v1/consulta/buscar/#condicion/#latitud,#longitud/#metros/#token;' var vecNombres = [ 'id de establecimiento', 'Nombre de la unidad económica:', 'Razón social:', 'Nombre de la clase de actividad:', 'Personal ocupado (estrato):', 'Tipo de vialidad:', 'Nombre de la vialidad:', 'Número exterior o km:', 'Número o letra interior:', 'Nombre del asentamiento humano:', 'Código postal:', 'Entidad,Municipio,Localidad:', 'Número de teléfono:', 'Correo electrónico:', 'Sitio en Internet:', 'Tipo de unidad económica:', 'Latitud:', 'Longitud:', 'Centro comercial:', 'Tipo de centro comercial:', 'Número de local:']; function llamarApiDenueBus(){ var condicion = $('#condi').val(); var longitud = $('#lon').val(); var latitud = $('#lat').val(); var metros = $('#mts').val(); var urlApiBusquedaTmp = urlApiBusqueda.replace('#condicion',condicion); urlApiBusquedaTmp = urlApiBusquedaTmp.replace('#latitud',latitud); urlApiBusquedaTmp = urlApiBusquedaTmp.replace('#longitud',longitud); urlApiBusquedaTmp = urlApiBusquedaTmp.replace('#metros',metros); urlApiBusquedaTmp = urlApiBusquedaTmp.replace('#token',token); $.getJSON( urlApiBusquedaTmp, function( json ) { var codHtml = ''; for(var i = 0; i < json.length; i++){ codHtml += '<table style="width:50%;">'; codHtml += '<tr><th colspan="2">Establecimiento ' + (i + 1) + '</th></tr>'; codHtml += '<tr><td style="width:50%;" >' + vecNombres[0] + '</td><td style="width:50%;">' + json[i].Id + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[1] + '</td><td style="width:50%;">' + json[i].Nombre + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[2] + '</td><td style="width:50%;">' + json[i].Razon_social + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[3] + '</td><td style="width:50%;">' + json[i].Clase_actividad + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[4] + '</td><td style="width:50%;">' + json[i].Estrato + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[5] + '</td><td style="width:50%;">' + json[i].Tipo_vialidad + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[6] + '</td><td style="width:50%;">' + json[i].Calle + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[7] + '</td><td style="width:50%;">' + json[i].Num_Exterior + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[8] + '</td><td style="width:50%;">' + json[i].Num_Interior + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[9] + '</td><td style="width:50%;">' + json[i].Colonia + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[10] + '</td><td style="width:50%;">' + json[i].CP + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[11] + '</td><td style="width:50%;">' + json[i].Ubicacion + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[12] + '</td><td style="width:50%;">' + json[i].Telefono + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[13] + '</td><td style="width:50%;">' + json[i].Correo_e + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[14] + '</td><td style="width:50%;">' + json[i].Sitio_internet + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[15] + '</td><td style="width:50%;">' + json[i].Tipo + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[16] + '</td><td style="width:50%;">' + json[i].Latitud + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[17] + '</td><td style="width:50%;">' + json[i].Longitud + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[18] + '</td><td style="width:50%;">' + json[i].CentroComercial + '</td></tr>'+ '<tr><td style="width:50%;" >' + vecNombres[19] + '</td><td style="width:50%;">' + json[i].TipoCentroComercial + '</td></tr>'+ '<tr><td style="width:50%;" >' +vecNombres[20] + '</td><td style="width:50%;">' + json[i].NumLocal + '</td></tr>' codHtml += '<tr><td></td></tr></table><br><br>'; } $('#tabDenue').html(codHtml); }); }