national-geographic-api
NodeJS National Geographic API
Table of Contents
Documentation
You can find documentation here
Installation
npm i national-geographic-api
Setup
Import
const natgeo = NationalGeographicAPI;
or
;
Features
- Get Latest News articles with title, description, img and other metadata
- Paginate news digest
- Promises and callback support on all functions, if no callback provided, promise returned, allows you to manage flow as you desire
- Typescript code with typings
Latest News
Returns the latest news from National Geographic News API with metadata.
natgeo ;
or
;
PAGE_SIZE
- optional, defaults to 3 story itemsPAGE_NUMBER
- optional, defaults to page 0CALLBACK
- optional, if no callback provided returns a promise
Photo of the Day
Returns requested Photo of the Day from National Geographic archives.
natgeo ;
or
;
DAY
- optional, defaults to today. Expects ISO date formatCALLBACK
- optional, if no callback provided returns a promise