# nat-geo-api

> (unofficial) National Geographic Photo of the Day API

Latest version **1.0.0** (published 2015-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install nat-geo-api
pnpm add nat-geo-api
yarn add nat-geo-api
bun add nat-geo-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2015-06-27 |
| First published | 2015-06-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 0.12 |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Sterling Whitley |
| Maintainers | sterlingw |
| Keywords | national geographic, photo of the day, national geographic api, nat geo, photo of the day api, photo api, photo |

## Links

- npm: https://www.npmjs.com/package/nat-geo-api
- npm.io page: https://npm.io/package/nat-geo-api

## Dependencies (3)

- [cheerio](https://npm.io/package/cheerio.md) ^0.18.0
- [express](https://npm.io/package/express.md) ^4.12.2
- [request](https://npm.io/package/request.md) ^2.53.0

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2015-06-27
- 0.0.1 — 2015-06-13

## README

## National Geographic Photo of the Day
Unofficial National Geographic Photo of the Day API.

Check out the [photo of the day on National Geographic's website](http://photography.nationalgeographic.com/photography/photo-of-the-day/).

# Usage
You can run the API on your own server or use the web version (slower, because it's hosted on the Heroku free tier. This is the URL for the web version:  [https://natgeoapi.herokuapp.com/api/dailyphoto](https://natgeoapi.herokuapp.com/api/dailyphoto).

```npm install --save nat-geo-api```

Require and initialize (example):

```
var photo = require("nat-geo-api");

photo.run({
  port: 8000
});
```

# Documentation
To run the API, call the ```run``` method, which accepts a single options object.

### Options (object)
- ```port``` (optional) - (integer) port for the API to run on
- ```cors``` (optional) - (boolean) wether or not to enable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)


### Photo of the Day API:
- Type: GET
- Params: none
- URL: /api/dailyphoto
- Example Response: 

```
{
  "src":  "//images.nationalgeographic.com/wpf/media-live/photos/000/888/cache/polar-bear-prey-kaktovik_88865_990x742.jpg",
  "alt":  "Picture of a polar bear and cub with prey in Kaktovik, Alaska",
  "credit":  "Photograph by <a href=\"http://yourshot.nationalgeographic.com/profile/804116/\">Yoh Fong Chan</a>, National Geographic Your Shot"
}
```

### License
MIT. Copyright (c) [Sterling Whitley](http://sterlingw.com)

---
_Source: https://npm.io/package/nat-geo-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
