Socket
Socket
Sign inDemoInstall

national-geographic-api

Package Overview
Dependencies
52
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    national-geographic-api

National Geographic API that can be used to retrieve the latest news, the latest photo of the day, with the ability to query historical news and historical photos.


Version published
Maintainers
1
Created

Readme

Source

national-geographic-api

NodeJS National Geographic API

version travis build codecov coverage Codacy Badge dependency status MIT License semantic-release Commitizen friendly stability-stable Greenkeeper JavaScript Style Guide

Installation

npm install national-geographic-api

Table of Contents

Setup

Import

const natgeo = require('national-geographic-api').API;

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
  • ES6+ code

Latest News

Returns the latest news from National Geographic News API with metadata.

natgeo.getLatestNews(`PAGE_SIZE` , `PAGE_NUMBER` , `CALLBACK` )
    .then((result) => ...);
  • PAGE_SIZE - optional, defaults to 3 story items
  • PAGE_NUMBER - optional, defaults to page 0
  • CALLBACK - optional, if no callback provided returns a promise

Photo of the Day

Returns requested Photo of the Day from National Geographic archives.

natgeo.getPhotoOfDay(`DAY` , `CALLBACK`)
    .then((result) => ...);
  • DAY - optional, defaults to today. Expects ISO date format
  • CALLBACK - optional, if no callback provided returns a promise

Keywords

FAQs

Last updated on 30 Oct 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc