Class

DatosAbiertos

DatosAbiertos(apiKey)

Represents Datos Abiertos class, which extends the FetchService class. This class provides methods to interact with the Datos Abiertos Datasets.

Full API specs: https://datos.gob.do/
Constructor

# new DatosAbiertos(apiKey)

Create an instance of the Datos Abiertos service.
Parameters:
Name Type Description
apiKey string The API key for authentication.

View Source services/gob.do/datos-abiertos.js, line 12

Methods

# async getDatasetCSVUrls(dataset) → {Promise|Object}

Retrieves and parses the dataset URLs for Datos Abiertos from the API.
Parameters:
Name Type Description
dataset string The name of the dataset to retrieve URLs for.

View Source services/gob.do/datos-abiertos.js, line 97

A promise that resolves to an array of dataset URLs.
Promise
Returns an array of dataset URLs.
Object
Example
// Example: Retrieve fuel prices for the Dominican Republic
// Full documentation: https://datos.gob.do/
async function getDatasetCSVUrls() {
    try {
        // const dataset = 'nomina-miembros-policiales-2019';
        // const dataset = 'trafico-2020';
        const dataset = 'recaudaciones-sirite-2021-2022';
        const daData = await aletheiaSDK.opendata.gob('datos-abiertos').getDatasetCSVUrls(dataset);
        console.log('Datos Abiertos Data:', daData);
    } catch (error) {
        console.error('Error retrieving Datos Abiertos data:', error);
    }
}
getDatasetCSVUrls();

# async getDatasetJSON(dataset) → {Promise|Object}

Retrieves and parses the dataset Datos Abiertos from the API.
Parameters:
Name Type Description
dataset string The name of the dataset to retrieve.

View Source services/gob.do/datos-abiertos.js, line 41

A promise that resolves to the fetched Datos Abiertos data.
Promise
Returns the fetched data from Datos Abiertos.
Object
Example
// Example: Retrieve fuel prices for the Dominican Republic
// Full documentation: https://datos.gob.do/
async function getDatosAbiertosDatasets() {
    try {
        const dataset = 'recaudaciones-sirite-2021-2022';
        const daData = await aletheiaSDK.opendata.gob('datos-abiertos').getDatasetJSON(dataset);
        console.log('Datos Abiertos Data:', daData.datasetJSON);
    } catch (error) {
        console.error('Error retrieving Datos Abiertos data:', error);
    }
}
getDatosAbiertosDatasets();