Skip to main content

Ninegagposts

PyPI GitHub license PyPI - Python Version


This is a python client to get 9Gag posts

Installation

Ninegagposts requires Python 3.6+ to run.

$ pip install ninegagposts

Examples

Get Last Post:

from ninegagposts import Client

Client.get_last_post() #returns a dictionary

Output Example:

{
  "id": "aB07d02",
  "url": "http://9gag.com/gag/aB07d02",
  "title": "I gotta get one of those",
  "type": "Animated",
  "nsfw": 0,
  "upVoteCount": 0,
  "downVoteCount": 0,
  "creationTs": 1562853914,
  "promoted": 0,
  "isVoteMasked": 1,
  "hasLongPostCover": 0,
  "images": {
    "image700": {
      "width": 460,
      "height": 571,
      "url": "https://img-9gag-fun.9cache.com/photo/aB07d02_460s.jpg"
    },
    "image460": {
      "width": 460,
      "height": 571,
      "url": "https://img-9gag-fun.9cache.com/photo/aB07d02_460s.jpg",
      "webpUrl": "https://img-9gag-fun.9cache.com/photo/aB07d02_460swp.webp"
    },
    "image460sv": {
      "width": 460,
      "height": 570,
      "url": "https://img-9gag-fun.9cache.com/photo/aB07d02_460sv.mp4",
      "hasAudio": 1,
      "duration": 44
    },
    "image460svwm": {
      "width": 460,
      "height": 570,
      "url": "https://img-9gag-fun.9cache.com/photo/aB07d02_460svwm.webm",
      "hasAudio": 1,
      "duration": 44
    }
  },
  "sourceDomain": "",
  "sourceUrl": "",
  "commentsCount": 0,
  "postSection": {
    "name": "Video",
    "url": "https://9gag.com/video",
    "imageUrl": "https://miscmedia-9gag-fun.9cache.com/images/thumbnail-facebook/1557283964.0386_avUmy5_100x100.jpg"
  },
  "tags": [],
  "descriptionHtml": ""
}

Get Fresh Posts:

from ninegagposts import Client

Client.get_fresh_posts() #returns a dictionary list

Get Hot Posts:

from ninegagposts import Client

Client.get_hot_posts() #returns a dictionary list

Get Trending Posts:

from ninegagposts import Client

Client.get_trending_posts() #returns a dictionary list

Get Posts by Group:

from ninegagposts import Client

Client.get_posts_by_group(group="default", type="fresh") #returns a dictionary list

Output Example:

[
  {
    "id": "awA6Zor",
    "url": "http://9gag.com/gag/awA6Zor",
    "title": "Kinetic Energy - Homage to Alfonso Wong",
    "type": "Photo",
    "nsfw": 0,
    "upVoteCount": 0,
    "downVoteCount": 0,
    "creationTs": 1562854100,
    "promoted": 0,
    "isVoteMasked": 1,
    "hasLongPostCover": 0,
    "images": {
      "image700": {
        "width": 700,
        "height": 1084,
        "url": "https://img-9gag-fun.9cache.com/photo/awA6Zor_700b.jpg",
        "webpUrl": "https://img-9gag-fun.9cache.com/photo/awA6Zor_700bwp.webp"
      },
      "image460": {
        "width": 460,
        "height": 712,
        "url": "https://img-9gag-fun.9cache.com/photo/awA6Zor_460s.jpg",
        "webpUrl": "https://img-9gag-fun.9cache.com/photo/awA6Zor_460swp.webp"
      }
    },
    "sourceDomain": "",
    "sourceUrl": "",
    "commentsCount": 0,
    "postSection": {
      "name": "Countryballs",
      "url": "https://9gag.com/countryballs",
      "imageUrl": "https://miscmedia-9gag-fun.9cache.com/images/thumbnail-facebook/1557310697.557_Ba4aSa_100x100.jpg"
    },
    "tags": [],
    "descriptionHtml": ""
  },
  {
    "id": "a5M8XRN",
    "url": "http://9gag.com/gag/a5M8XRN",
    "title": "Americat",
    "type": "Photo",
    "nsfw": 0,
    "upVoteCount": 0,
    "downVoteCount": 0,
    "creationTs": 1562854100,
    "promoted": 0,
    "isVoteMasked": 1,
    "hasLongPostCover": 0,
    "images": {
      "image700": {
        "width": 700,
        "height": 52,
        "url": "https://img-9gag-fun.9cache.com/photo/a5M8XRN_700b.jpg",
        "webpUrl": "https://img-9gag-fun.9cache.com/photo/a5M8XRN_700bwp.webp"
      },
      "image460": {
        "width": 460,
        "height": 34,
        "url": "https://img-9gag-fun.9cache.com/photo/a5M8XRN_460s.jpg",
        "webpUrl": "https://img-9gag-fun.9cache.com/photo/a5M8XRN_460swp.webp"
      }
    },
    "sourceDomain": "",
    "sourceUrl": "",
    "commentsCount": 0,
    "postSection": {
      "name": "Countryballs",
      "url": "https://9gag.com/countryballs",
      "imageUrl": "https://miscmedia-9gag-fun.9cache.com/images/thumbnail-facebook/1557310697.557_Ba4aSa_100x100.jpg"
    },
    "tags": [],
    "descriptionHtml": ""
  }
]

Release files for ninegagposts 0.0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ninegagposts 0.0.1.5
File Size Uploaded
ninegagposts-0.0.1.5.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ninegagposts 0.0.1.5
File Interpreter ABI Platform
ninegagposts-0.0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / ninegagposts-0.0.1.5.tar.gz

Download URL ninegagposts-0.0.1.5.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b519a82e74bc4fe2dccef7e899340677fd567d4a1dfb8f0c7a9658f7afdafaef
BLAKE2b-256 checksum
How to use checksums
ba00d1f3113b24dc1b8757283ff20257ea23f03a2c7ab51f8fab55b4815b43cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

Release files / ninegagposts-0.0.1.5-py3-none-any.whl

Download URL ninegagposts-0.0.1.5-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f31649fcde595fd30d175564f16accbc30cc697d06fcee56adcb76659922edd
BLAKE2b-256 checksum
How to use checksums
80674d6197f749d754d771baafee58f53a1cf26c20f6cb4382799c14d05f470e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.0.1.5 This release

2 release files

0.0.1.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page