Class

OpenData

OpenData(apiKey)

Open Data Class Represents methods for accessing open data provided by the Dominican Republic government or private organizations. This class extends the FetchService class and includes specialized modules for different open data providers, such as MapGob, DGCP, DGII, and Aletheia.
Constructor

# new OpenData(apiKey)

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

View Source services/openData.js, line 22

Extends

  • FetchService

Methods

# fuelPrices(param, value) → {Promise|Object}

Retrieves fuel prices from the API based on the specified parameter and value.

Full documentation: https://developer.digital.gob.do/apis/fdf3319d-521e-4364-b331-9d521e636442
Parameters:
Name Type Description
param string The parameter to filter the fuel prices by.
value string The value of the parameter to filter the fuel prices by.

View Source services/openData.js, line 58

A promise that resolves to the fetched fuel prices data.
Promise
Returns information regarding fuel prices in the dominican republic.
Object
Example
// Example: Retrieve fuel prices for the Dominican Republic
// Full documentation: https://developer.digital.gob.do/apis/fdf3319d-521e-4364-b331-9d521e636442
async function getFuelPrices() {
  try {
    const fuelPrices = await aletheiaSDK.opendata.fuelPrices('date', '2023-11-01');
    console.log('Fuel Prices:', fuelPrices);
  } catch (error) {
    console.error('Error retrieving fuel prices:', error);
  }
}
getFuelPrices();

# async getBankDetail(linkDetail) → {Promise.<Object>}

UNOFFICIAL: https://github.com/Erinxon/api-bancos-republica-dominicana Retrieves detailed information about a bank based on the provided URL.

Full documentation: https://banks.fly.dev/swagger/index.html
Parameters:
Name Type Description
linkDetail string The URL link of the bank's details.

View Source services/openData.js, line 125

- Throws an error if there is an issue with the API request.
Error
- A Promise that resolves to the detailed information about the bank.
Promise.<Object>
Example
async function getDominicanBankDetails() {
  try {
    const linkDetail = 'https://sb.gob.do/supervisados/entidades-de-intermediacion-financiera/banreservas/';
    const bankDetails = await aletheiaSDK.opendata.getBankDetail(linkDetail);
    console.log('Dominican Bank:', bankDetails);
  } catch (error) {
    console.error('Error retrieving fuel prices:', error);
  }
}
getDominicanBankDetails();

# async getBanks() → {Promise.<Object>}

UNOFFICIAL: https://github.com/Erinxon/api-bancos-republica-dominicana Retrieves a list of banks from the API.

Full documentation: https://banks.fly.dev/swagger/index.html

View Source services/openData.js, line 98

- Throws an error if there is an issue with the API request.
Error
- A Promise that resolves to the list of banks.
Promise.<Object>
Example
async function getDominicanBanks() {
  try {
    const banks = await aletheiaSDK.opendata.getBanks();
    console.log('Dominican Banks:', banks);
  } catch (error) {
    console.error('Error retrieving fuel prices:', error);
  }
}
getDominicanBanks();

# getTerritoryData(territoryType, params) → {Promise}

Retrieves data for various territories such as regions, provinces, municipalities, etc.

Full documentation: https://developer.digital.gob.do/apis/34995f58-a45f-4b9e-995f-58a45f2b9e92
Parameters:
Name Type Description
territoryType string The type of territory to retrieve (e.g., 'regions', 'provinces').
params Object Additional parameters to include in the request.

View Source services/openData.js, line 71

A promise that resolves to the fetched territory data.
Promise