E Hentai JSON API - tommy351/ehreader-android GitHub Wiki

This application uses E-Hentai JSON API to fetch gallery data. The following is the API used in the app. You can also see wiki for more information.

Overview

Commands

Gallery data (gdata)

Get the gallery data from the following URL format:

http://g.e-hentai.org/s/{page_token}/{gallery_id}-{pagenumber}

Request

You can have 25 entires at most in gidlist property.

{
  "method": "gdata",
  "gidlist": [
    [
      618395, "0439fa3666"
    ]
  ]
}

Response

Success

{
 "gmetadata": [
   {
     "gid": 618395,
     "token": "0439fa3666",
     "archiver_key": "382385--9764970b04b79524bcbdc984e4c7857561397907",
     "title": "(TouKou 8) [Handful☆Happiness! (Fuyuki Nanahara)] TOUHOU GUNMANIA A2 (Touhou Project)",
     "title_jpn": "(東方紅楼夢8) [Handful☆Happiness! (七原冬雪)] TOUHOU GUNMANIA A2 (東方Project)",
     "category": "Non-H",
     "thumb": "http://gt1.ehgt.org/14/63/1463dfbc16847c9ebef92c46a90e21ca881b2a12-1729712-4271-6032-jpg_l.jpg",
     "uploader": "avexotsukaai",
     "posted": "1376143500",
     "filecount": "20",
     "filesize": 51210504,
     "expunged": false,
     "rating": "4.64",
     "torrentcount": "1",
     "tags": [
       "touhou project",
       "handful happiness",
       "fuyuki nanahara",
       "full color"
     ]
   }
 ]
}

Error

{
  "gid": 618395,
  "error": "Key missing, or incorrect key provided."
}

Properties

  • gid: Gallery ID
  • token: Gallery token
  • archiver_key: Archiver key
  • title: Title
  • title_jpn: Japanese title
  • category: Category
  • thumb: Thumbnail
  • uploader: Uploader
  • posted: Posted date (UNIX timestamp)
  • filecount: The number of photos
  • filesize: Total size in bytes
  • expunged: Whether the gallery is expunged
  • rating: Rating (0~5)
  • torrentcount: The number of torrents
  • tags - Tags

Gallery token (gtoken)

Get the gallery token from the following URL format:

http://g.e-hentai.org/s/{page_token}/{gallery_id}-{pagenumber}

Request

You can have 25 entries at most in pagelist property.

{
  "method": "gtoken",
  "pagelist": [
    [
      618395, "40bc07a79a", 11
    ]
  ]
}

Response

Success

{
  "tokenlist": [
    {
      "gid": 618395,
      "token": "0439fa3666"
    }
  ]
}

Error

{
  "tokenlist": [
    {
      "gid": 618395,
      "error": "Invalid page."
    }
  ]
}

Photo page (showpage)

Get the photo page.

Request

imgkey is the photo token. showkey is a key changed every day. The only way to get the showkey is to parse the HTML.

{
  "method": "showpage",
  "gid": 618395,
  "page": 1,
  "imgkey": "1463dfbc16",
  "showkey": "387132-43f9269494"
}

Response

Success

{
  "p": 1,
  "s": "s/1463dfbc16/618395-1",
  "n": "<div class=\"sn\"><a onclick=\"return load_image(1, '1463dfbc16')\" href=\"http://g.e-hentai.org/s/1463dfbc16/618395-1\"><img src=\"http://ehgt.org/g/f.png\" /></a><a id=\"prev\" onclick=\"return load_image(1, '1463dfbc16')\" href=\"http://g.e-hentai.org/s/1463dfbc16/618395-1\"><img src=\"http://ehgt.org/g/p.png\" /></a><div><span>1</span> / <span>20</span></div><a id=\"next\" onclick=\"return load_image(2, '8db045702f')\" href=\"http://g.e-hentai.org/s/8db045702f/618395-2\"><img src=\"http://ehgt.org/g/n.png\" /></a><a onclick=\"return load_image(20, 'f3355abf33')\" href=\"http://g.e-hentai.org/s/f3355abf33/618395-20\"><img src=\"http://ehgt.org/g/l.png\" /></a></div>",
  "i": "<div>IMG_0032.jpg :: 1200 x 1695 :: 159.20 KB</div>",
  "k": "1463dfbc16",
  "i3": "<a onclick=\"return load_image(2, '8db045702f')\" href=\"http://g.e-hentai.org/s/8db045702f/618395-2\"><img id=\"img\" src=\"http://72.174.21.70:11075/h/95d6686fa26081e921a4342deea414522604feed-163025-1200-1695-jpg/keystamp=1393677900-297404a433/IMG_0032.jpg\" style=\"width:1200px;height:1695px\" /></a>",
  "i5": "<div class=\"sb\"><a href=\"http://g.e-hentai.org/g/618395/0439fa3666/\"><img src=\"http://ehgt.org/g/b.png\" /></a></div>",
  "i6": " &nbsp; <img src=\"http://ehgt.org/g/mr.gif\" class=\"mr\" /> <a href=\"http://g.e-hentai.org/?f_shash=1463dfbc16847c9ebef92c46a90e21ca881b2a12;95d6686fa26081e921a4342deea414522604feed&amp;fs_from=IMG_0032.jpg+from+%28Kouroumu+8%29+%5BHandful%E2%98%86Happiness%21+%28Fuyuki+Nanahara%29%5D+TOUHOU+GUNMANIA+A2+%28Touhou+Project%29\">Show all galleries with this file</a>  &nbsp; <img src=\"http://ehgt.org/g/mr.gif\" class=\"mr\" /> <a href=\"#\" onclick=\"prompt('Copy the URL below.', 'http://g.e-hentai.org/r/95d6686fa26081e921a4342deea414522604feed-163025-1200-1695-jpg/forumtoken/618395-1/IMG_0032.jpg'); return false\">Generate a static forum image link</a>  &nbsp; <img src=\"http://ehgt.org/g/mr.gif\" class=\"mr\" /> <a href=\"#\" onclick=\"return nl(6049)\">Click here if the image fails loading</a> ",
  "i7": " &nbsp; <img src=\"http://ehgt.org/g/mr.gif\" class=\"mr\" /> <a href=\"http://g.e-hentai.org/fullimg.php?gid=618395&amp;page=1&amp;key=7079f01190\">Download original 4271 x 6032 1.65 MB source</a>",
  "si": 6049,
  "x": "1200",
  "y": "1695"
}

Error

The API returns plain text.

Invalid page.

Properties

This shit is such a mess.

  • p: Page
  • s: URL
  • n
  • i
  • k: Token
  • i3
  • i5
  • i6
  • i7
  • si: Photo size in bytes
  • x: Width
  • y: Height
⚠️ **GitHub.com Fallback** ⚠️