API Network Exploration: NAB API

Avatar

This is part of our blog series on Postman API Network – a directory of APIs that allows developers to find APIs running in Postman. Each month, we explore one API from our API network and help you become familiar with some of these incredibly useful APIs. Last month, we covered the AirVisual API and this month’s feature is the NAB API.

NAB API

NAB API provided by the National Australia Bank (NAB) Limited offers information about the banking institution including locations, exchange rates and account details. While it is very rare to see large banks opening up their APIs to developers due to security concerns, NAB firmly believes in creating great customer experiences. The institution wants to work with developers to create the next generation of innovative customer experiences.

NAB API has a ready-to-use Postman Collection which allows you to fetch the current forex rates and also fetch the location of the NAB banking centres, branches, and ATMs for a given address.

NAB API Postman Collection
NAB API Postman Collection
 

To use the NAB API, you will need an API key, which can be obtained by visiting the NAB Developer Portal. To simplify the process, NAB does provide a Sandbox API key to build the apps in test mode. You can request for the Production API key by signing up on the portal.

The Fx rate request allows you to fetch the current buy and sell rate for any currency converted to Australian Dollar. You can also get the previous buy and sell rate. The API enables you to get the exchange rate for the US Dollar and the New Zealand Dollar.

The Fx rate API request to find the exchange rate
{
    "fxRatesResponse": {
        "fxRates": [
            {
                "buyCurrency": "USD",
                "sellCurrency": "AUD",
                "currentBuyRate": "0.76456",
                "currentSellRate": "0.72229",
                "previousBuyRate": "0.76456",
                "previousSellRate": "0.72229"
            },
            {
                "buyCurrency": "NZD",
                "sellCurrency": "AUD",
                "currentBuyRate": "0.86456",
                "currentSellRate": "0.82229",
                "previousBuyRate": "0.86456",
                "previousSellRate": "0.82229"
            }
        ],
        "lastUpdatedDate": "2015-12-15T15:43:00Z"
    },
    "status": {
        "code": "API-200",
        "message": "Success"
    }
}

Response body for the Get Fx API request

Using NAB API to power your apps

A noteworthy feature of the NAB API is the ability to fetch data about the locations of the NAB branches. For example, if your app requires to display details about the bank like address, working hours, then you can use the API to display the data.

If you want to display all the ATMs in the region, set the location type as “atm”. The response will display the address along with geo coordinates, functioning hours. You can also check for several other parameters like deposit facility, disability approved, audio support. You can even calculate the distance to the location based on the geolocation.

Request to fetch all ATMs near the location
{
    "locationSearchResponse": {
        "totalRecords": 6,
        "address": {
            "formattedAddress": "Tasmania 7030, Australia",
            "latitude": -42.1876915,
            "longitude": 147.0214014
        },
        "viewport": {
            "swLat": -44.8826008,
            "swLng": 144.3264921,
            "neLat": -39.4927822,
            "neLng": 149.7163107
        },
        "locations": [
            {
                "apiStructType": "nab",
                "nab": {
                    "location": "Offsite",
                    "isDeposit": false,
                    "isDisabilityApproved": true,
                    "isAudio": false,
                    "source": "NAB",
                    "address3": "Eastlands Shopping Centre",
                    "id": 16271,
                    "key": "nab_3B93",
                    "description": "Eastlands Shopping Centre",
                    "address1": "1 Bligh Street",
                    "suburb": "Rosny Park",
                    "state": "TAS",
                    "postcode": "7018",
                    "latitude": -42.8680382,
                    "longitude": 147.3692568,
                    "hours": "Mon-Thu 09.00am-05.30pm, Fri 09.00am-08.00pm, Sat 09.00am-05.00pm, Sun 10.00am-04.00pm",
                    "distanceToLocation": 80844
                }
            }
        ]
    },
    "status": {
        "code": "API-200",
        "message": "Success"
    }
}

Response body for the Location API request

Similarly, if you want to display the nearest branch, you need to set the location type as “brc”. This query lets you access different parameters related to the branch. You get the standard address with geo coordinates, the operational timings, and the distance from the current location of the user. Additionally, you can get very relevant details like the BSB code of the branch, and availability of facilities including coin swap, quick change, internet banking, intelligent deposit.

Request to fetch branch location in the region
{
    "locationSearchResponse": {
        "totalRecords": 1,
        "address": {
            "formattedAddress": "Tasmania 7030, Australia",
            "latitude": -42.1876915,
            "longitude": 147.0214014
        },
        "viewport": {
            "swLat": -44.8826008,
            "swLng": 144.3264921,
            "neLat": -39.4927822,
            "neLng": 149.7163107
        },
        "locations": [
            {
                "apiStructType": "nab",
                "nab": {
                    "bsb": "7007",
                    "siteName": "Hobart Office",
                    "isRural": false,
                    "openWeekends": false,
                    "hasCoinSwap": false,
                    "hasQuickChange": false,
                    "bbc": false,
                    "expressBusinessDeposit": false,
                    "hasIntelligentDeposit": false,
                    "foreignCurrency": false,
                    "internetBank": true,
                    "financialPlanner": false,
                    "mobileBanker": false,
                    "smallBusinessBankers": [
                        {
                            "name": "Brooke Batchelor",
                            "key": "158"
                        }
                    ],
                    "id": 6849,
                    "key": "nab_LOC000955",
                    "description": "Hobart Office",
                    "address1": "76 Liverpool St",
                    "suburb": "Hobart",
                    "state": "TAS",
                    "postcode": "7000",
                    "latitude": -42.88127,
                    "longitude": 147.327172,
                    "hours": "Mon-Thu 9.00am-4.00pm, Fri 9.00am-5.00pm",
                    "distanceToLocation": 7621
                }
            }
        ]
    },
    "status": {
        "code": "API-200",
        "message": "Success"
    }
}

Response body for the Location API request

Further, the API also allows to display details about agencies. To check agencies, set the location type as “agn”. The API will fetch all the details including name, address, email and contact number.

Request to fetch agent details
{
    "locationSearchResponse": {
        "totalRecords": 1,
        "address": {
            "formattedAddress": "Tasmania 7030, Australia",
            "latitude": -42.1876915,
            "longitude": 147.0214014
        },
        "viewport": {
            "swLat": -44.8826008,
            "swLng": 144.3264921,
            "neLat": -39.4927822,
            "neLng": 149.7163107
        },
        "locations": [
            {
                "apiStructType": "banker",
                "banker": {
                    "id": 1204,
                    "key": "banker_158",
                    "type": "nab",
                    "name": "Brooke Batchelor",
                    "address1": "Level 1, 76 Liverpool Street",
                    "suburb": "Hobart",
                    "state": "TAS",
                    "postcode": "7000",
                    "email": "Brooke.M.Batchelor@nab.com.au",
                    "fax": "0362316102",
                    "phone": "0477396353",
                    "mobile": "0477396353",
                    "buid": "TBA",
                    "servicingArea": "Tasmania",
                    "homeBranches": [
                        {
                            "name": "Hobart Office",
                            "key": "LOC000955"
                        }
                    ]
                }
            }
        ]
    },
    "status": {
        "code": "API-200",
        "message": "Success"
    }
}

Response body for the Location API request

This is just one use case of the NAB API. If you would like to experiment with the NAB API collection, you can run the collection in Postman.

 

To access this collection directly in the Postman app, click the orange “New” button in the top left corner and select the API Network tab. A pop-up screen will then appear. You can either browse all the published APIs or search for the NAB API.

The API Network in the Postman app

To know more, visit the Postman Learning Center.

You can check out the other APIs running in Postman by visiting the API Network or search for them within the Postman app. If you have an awesome API collection and would like to reach 10 million+ developers, you can publish your API on our API Network.

Tags:

What do you think about this topic? Tell us in a comment below.

Comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.