FCER Web API Services
Philippine Ports Authority
Foreign Currency Exchange Rate System | Version 1.0.0
Endpoint Documentation
Updated: 07/08/2022 | Written: 04/12/2022
This endpoint can be used by any registered system in the FCER Web API Application. It can be called by any application from PHP, JAVA, mobile apps, console apps, database systems, or any platforms supporting HTTP requests. It emits universal JSON data format.


I — Endpoint and Payload Documentation
METHOD URI / DESCRIPTION UPDATED
POST
https://api.ppa.com.ph/api/fcer/getrate

Gets the exchange rate for the day, or a given date (historical), based on the parameters or payload given.
PAYLOAD
Name Required Type Description
SystemUserId YES String The system's registered name to use the FCER services. This is in the acronym format. For example: POMS
IdentKey YES String A registered system, is provided with an identification key, this is used as a ticket to use the FCER services. The FCER Admin provides this information.
FromSymbol NO String If the value of this field is omitted, the default would be in USD. Please refer to the provided user manual for all the available monetary symbols that FCER supports.
Day NO Number The numerical day value of a specific date in a month.
Example: The date 10/16/1980, the numeric value 16 is the day.
Month NO Number The numerical month value of a specific date in a month.
Example: The date 10/16/1980, the numeric value 10 is the month.
Year NO Number The numerical year value of a specific date in a month.
Example: The date 10/16/1980, the numeric value 1980 is the year.
NOTES on specifying Day, Month and Year:
  • Specifying all these fields grants historical exchange rate acquisition.
  • If either one of the fields is or not not specified, the current day acquisition rate is acquired, regardless if the source (e.g. BSP) is updated or not.
  • If all the date parameters are supplied, the data exchange rate provided only starts on the date when the FCER Web API System is officially deployed. Specifying earlier or later dates than the current date will not show any results.
EXAMPLES
1) Below given JSON payload, a request is made by POMS specifying the date, on June 29, 2022. The acquisition symbol is in USD, United States Dollars.


After a successful request, below JSON data is emitted back by FCER.

2) Below given JSON payload, a request is made by POMS specifying the date, on June 29, 2022. The acquisition symbol is in UDS, which is unsupported money symbol.


After a successful request, below JSON data is emitted back by FCER.

3) Take a closer look at below given JSON payload. At the time of this writing, it has acquired the latest exchange rate gathered by the FCER system.


After a successful request, below Web API Response JSON data is emitted back by FCER. However, the "SourcePostDate" which is a Friday, July 8, 2022, is behind by one day of the DateAcquired value. Note that SourcePostDate is the date of the third party system (e.g. BSP) when they posted the exchange rate values.
The reason for a day behind value is that, BSP do not post or update exchange rates on Saturdays and Sundays (as of this writing). Even if PPA's FCER system acquired the values on time, based on the scheduled automatic acquisition system, FCER will, still scrape what is currently posted in the BSP website.

4) Multiple symbols/monetary request. Given below payload, FCER can accept multiple symbols for exchange rate. At the time of this writing, only BSP as unit source supports multiple requests.


Notice below the property ExtraData, it contains the exchange rates in array object format containing the exchange rates. The red boxed Rem (remarks) indicates a status of Monetery unit not supported.
JUL-09-2022
« Back to Table of Contents
II — Web API Response Documentation
Detailed below is the description of each response field emitted back by FCER system. Find below example response JSON data.
There are eleven (11) response fields. Descriptions below explains each.
  • Message — This field indicates informative information about the request.
  • Succeeded — A boolean value indicating wether the request fails or not.
  • ExtraData — This is a filler field. No data is gathered for this at the time of this writing.
  • FromSymbol — This is the submitted symbol from the payload request.
  • ExchangeRate — The value of the exchange rate based on the symbol submitted. This value is in Philippine Peso (PHP).
  • UnitSource — The source at which FCER has acquired exchange rate value from. This is determined by the FCER Admin setting. Please refer to the user guide submitted for more information.
  • SystemUserId — The registered system name that requested the exchange rate. This is based on the payload.
  • RequestIp — The source IP address of the requestor, i.e. the machine where the requesting system is running.
  • RequestStatusId — This represents the following:
    S Success
    FNI FEATURE NOT IMPLEMENTED
    This happens if the selected source module is not implemented yet, e.g. PPA Source
    ND NO DATA
    If a symbol or monetary unit is not found, this status is emitted back. As well, if the system is unable to acquire data from source, e.g. BSP, this status is given.
    FS FAILED - UNABLE TO CONTACT SERVICE
    The source website or service is offline or due to network issues.
    IN INVALID DATA OPERATION
    The source data cannot be read properly.
  • DateAcquired — This indicates the date of FCER server when the exchange rate values are acquired.
  • SourcePostDate — Tells the date when the source system (e.g. BSP) posted the exchange rate values.
    NOTE: Regardless if the source data is updated or not, FCER will pick or scrape the values down.
III — Important Technical Matters
These important notes covers only BSP as the souce of the exchange rate.
NOTE 1 : Since BSP does not provide a real web API service, the method at which FCER acquires data is through web scraping. In other words, FCER system parses and reads data from a web page from BSP located at https://www.bsp.gov.ph/SitePages/Statistics/ExchangeRate.aspx.

NOTE 2 : Acquiring exchange rate may take several seconds to perform, or even minutes because of the scraping process.

NOTE 3 : In order to scrape BSP's exchange rate website, Selenium™ Google Chromer driver is used. This implies that, when FCER server's Google Chrome browser is updated (manually or automatically), so is the Chrome driver that came with FCER app -- updating FCER driver is manual. This is IMPORTANT.

NOTE 4 : It is recommended that setting the auto-acquisition for BSP ahead, from two (2) to five (5) minutes of the the target policy time.

NOTE 5: In case the automatic acquisition is not displaying the data in the audit grid of FCER page, from the targetted time schedule, a log file can be accessed in the FCER Server located at D:\PpaWebApiRepo\Logs\Fcer\Tasks
// End of documentation. Nothing follows.
« Back to Table of Contents