4plebs.org API Documentation v0.0.3

Basic FoolFuuka

GET
Return post

Returns the post object

GET /post/

Required parameters

Name /type

Description /example

Constraints

board
string

Board shortname

"plebs"

    num
    number

    Number of the post.

    1

      cURL

      curl -X GET "http://archive.4plebs.org/_/api/chan/post/?board=plebs&num=1" \
      

      Response

      {
        "doc_id": "1",
        "num": "1",
        "subnum": "0",
        "thread_num": "1",
        "op": "1",
        "timestamp": "1366825828",
        "timestamp_expired": "0",
        "capcode": "N",
        "email": null,
        "name": "Anonymous",
        "trip": null,
        "title": null,
        "comment": "4plebs?",
        "poster_hash": null,
        "poster_country": null,
        "sticky": "0",
        "locked": "0",
        "deleted": "0",
        "nreplies": null,
        "nimages": null,
        "fourchan_date": "4/24/13(Wed)13:50",
        "comment_sanitized": "4plebs?",
        "comment_processed": "4plebs?",
        "formatted": false,
        "title_processed": null,
        "name_processed": "Anonymous",
        "email_processed": null,
        "trip_processed": null,
        "poster_hash_processed": null,
        "poster_country_name": false,
        "poster_country_name_processed": "",
        "media": {
          "media_id": "1",
          "spoiler": "0",
          "preview_orig": "13668258289537s.jpg",
          "media": "13668215782696.jpg",
          "preview_op": "13668258289537s.jpg",
          "preview_reply": null,
          "preview_w": "209",
          "preview_h": "250",
          "media_filename": "feelcup.jpg",
          "media_w": "645",
          "media_h": "773",
          "media_size": "51338",
          "media_hash": "UGaaniyM723FBlG4b77z/w==",
          "media_orig": "13668215782696.jpg",
          "exif": "{\"FileName\":\"d4c564ed648381f49af029c9443de206.jpg\",\"FileDateTime\":1366825827,\"FileSize\":51338,\"FileType\":2,\"MimeType\":\"image\\/jpeg\",\"SectionsFound\":\"\",\"COMPUTED\":{\"html\":\"width=\\\"645\\\" height=\\\"773\\\"\",\"Height\":773,\"Width\":645,\"IsColor\":1}}",
          "total": "2",
          "banned": "0",
          "media_status": "normal",
          "safe_media_hash": "UGaaniyM723FBlG4b77z_w",
          "remote_media_link": null,
          "media_link": "http://img.4plebs.org/boards/plebs/image/1366/82/13668215782696.jpg",
          "thumb_link": "http://img.4plebs.org/boards/plebs/thumb/1366/82/13668258289537s.jpg",
          "media_filename_processed": "feelcup.jpg"
        },
        "board": {
          "name": "4plebs discussion",
          "shortname": "plebs"
        }
      }

      GET
      Return thread

      Returns the thread object

      GET /thread/

      Required parameters

      Name /type

      Description /example

      Constraints

      board
      string

      Board shortname

      "plebs"

        num
        number

        Number of the thread

        1

          cURL

          curl -X GET "http://archive.4plebs.org/_/api/chan/thread/?board=plebs&num=1" \
          

          Response

          {
            "1": {
              "op": {
                // post object //
              },
              "posts": {
                "1_7": {
                  // post object //
                },
                "1_8": {
                  // post object //
                }
              }
            }
          }

          GET
          Return board index

          Returns the board index

          GET /index/

          Required parameters

          Name /type

          Description /example

          Constraints

          board
          string

          Board shortname

          "plebs"

            page
            number

            Page number

            1

              Optional parameters

              Name /type

              Description /example

              Constraints

              order
              string

              Page order

              "by_thread"
              • default value: by_thread
              • valid values: by_post, by_thread, ghost

              cURL

              curl -X GET "http://archive.4plebs.org/_/api/chan/index/?board=plebs&page=1&order=by_thread" \
              

              Response

              {
                "1145": {
                  "omitted": 0,
                  "images_omitted": 0,
                  "op": {
                    // post object //
                  },
                  "posts": [
                    // post objects //
                  ]
                },
                "1148": {
                  "omitted": 0,
                  "images_omitted": 0,
                  "op": {
                    // post object //
                  },
                  "posts": [
                    // post objects //
                  ]
                },
                // ... //
              }

              GET
              Search function

              Returns search results. Search API is limited to 5 requests per minute. Other end points aren't limited.

              GET /search/

              Optional parameters

              Name /type

              Description /example

              Constraints

              start
              string

              Start date. Format: YYYY-MM-DD.

              ""

                filename
                string

                ""

                  subject
                  string

                  ""

                    text
                    string

                    ""

                      boards
                      string

                      Board shortname. Dot delimiter for multiple.

                      "adv.trv"

                        order
                        string

                        Order of posts.

                        "asc"
                        • default value: desc
                        • valid values: asc, desc

                        ghost
                        string

                        Ghost posts.

                        "none"
                        • valid values: only, none

                        uid
                        string

                        ""

                          tripcode
                          string

                          ""

                            username
                            string

                            ""

                              country
                              string

                              ""

                                results
                                string

                                Results grouped by thread or none.

                                ""
                                • valid values: thread

                                filter
                                string

                                Filter.

                                "image"
                                • valid values: image, text

                                deleted
                                string

                                Deleted or not.

                                "not-deleted"
                                • valid values: deleted, not-deleted

                                type
                                string

                                Post type.

                                "posts"
                                • valid values: sticky, op, posts

                                end
                                string

                                End date. Format: YYYY-MM-DD.

                                ""

                                  image
                                  string

                                  Base64 encoded md5 hash of media file.

                                  ""

                                    email
                                    string

                                    ""

                                      capcode
                                      string

                                      Capcode.

                                      "user"
                                      • default value: user
                                      • valid values: user, ver, mod, dev, admin, manager, founder

                                      cURL

                                      curl -X GET "http://archive.4plebs.org/_/api/chan/search/?boards=adv.trv&email=&username=&tripcode=&capcode=user&subject=&text=&uid=&country=&filename=&image=&deleted=not-deleted&ghost=none&filter=image&type=posts&start=&end=&results=&order=asc" \
                                      

                                      Response

                                      {
                                        "0": {
                                          "posts": [
                                            {
                                              // post object //
                                            },
                                            {
                                              // post object //
                                            },
                                            // ... //
                                          ]
                                        },
                                        "meta": {
                                          "total_found": 3681872,
                                          "max_results": 5000,
                                          "search_title": "Searching for posts that has not been deleted and that are not by ghosts and that are only non-OP posts and that do not contain images and that were made by users and in ascending order."
                                        }
                                      }

                                      4plebs specific

                                      GET
                                      Site information

                                      Returns site information, archives and boards

                                      GET /site/

                                      cURL

                                      curl -X GET "http://archive.4plebs.org/_/api/chan/site/" \
                                      

                                      Response

                                      {
                                        "site": {
                                          "url": "http://archive.4plebs.org/",
                                          "name": "4plebs",
                                          "title": "4plebs",
                                          "notices": null,
                                          "media_http": [
                                            "http://img.4plebs.org/boards"
                                          ],
                                          "media_https": [
                                            "https://img.4plebs.org/boards"
                                          ],
                                          "global_search_enabled": true
                                        },
                                        "archives": {
                                          "10": {
                                            "name": "Advice",
                                            "shortname": "adv",
                                            "board_url": "http://archive.4plebs.org/adv/",
                                            "threads_per_page": "10",
                                            "original_board_url": "http://boards.4chan.org/adv/",
                                            "thumbs_url": "",
                                            "images_url": "",
                                            "anonymous_default_name": "Anonymous",
                                            "max_comment_characters_allowed": "4096",
                                            "max_comment_lines_allowed": "20",
                                            "cooldown_new_comment": "10",
                                            "transparent_spoiler": true,
                                            "enable_flags": false,
                                            "display_exif": false,
                                            "enable_poster_hash": false,
                                            "disable_ghost": false,
                                            "is_nsfw": false,
                                            "hide_thumbnails": false,
                                            "search_enabled": true,
                                            "board_hidden": false,
                                            "archive_full_images": true
                                          },
                                          // ... //
                                        },
                                        "boards": {
                                          "1": {
                                            "name": "4plebs discussion",
                                            "shortname": "plebs",
                                            "board_url": "http://archive.4plebs.org/plebs/",
                                            "threads_per_page": "10",
                                            "original_board_url": "http://archive.4plebs.org/plebs/",
                                            "thumbs_url": "",
                                            "images_url": "",
                                            "anonymous_default_name": "Anonymous",
                                            "max_comment_characters_allowed": "4096",
                                            "max_comment_lines_allowed": "20",
                                            "cooldown_new_comment": "30",
                                            "transparent_spoiler": true,
                                            "enable_flags": false,
                                            "display_exif": false,
                                            "enable_poster_hash": false,
                                            "disable_ghost": false,
                                            "is_nsfw": false,
                                            "hide_thumbnails": false,
                                            "search_enabled": false,
                                            "board_hidden": false,
                                            "internal_board_settings": {
                                              "op_image_upload_necessity": "always",
                                              "thumbnail_op_width": "250",
                                              "thumbnail_op_height": "250",
                                              "thumbnail_reply_width": "125",
                                              "thumbnail_reply_height": "125",
                                              "max_image_size_kilobytes": "10240",
                                              "max_image_size_width": "11000",
                                              "max_image_size_height": "11000",
                                              "max_posts_count": "400",
                                              "max_images_count": "250",
                                              "cooldown_new_thread": "300",
                                              "thread_lifetime": "1728000",
                                              "min_image_repost_time": "1"
                                            }
                                          }
                                        }
                                      }

                                      GET
                                      Archives information

                                      Returns site information and archives

                                      GET /archives/

                                      cURL

                                      curl -X GET "http://archive.4plebs.org/_/api/chan/archives/" \
                                      

                                      Response

                                      {
                                        "site": {
                                          "url": "http://archive.4plebs.org/",
                                          "name": "4plebs",
                                          "title": "4plebs",
                                          "notices": null,
                                          "media_http": [
                                            "http://img.4plebs.org/boards"
                                          ],
                                          "media_https": [
                                            "https://img.4plebs.org/boards"
                                          ],
                                          "global_search_enabled": true
                                        },
                                        "archives": {
                                          "10": {
                                            "name": "Advice",
                                            "shortname": "adv",
                                            "board_url": "http://archive.4plebs.org/adv/",
                                            "threads_per_page": "10",
                                            "original_board_url": "http://boards.4chan.org/adv/",
                                            "thumbs_url": "",
                                            "images_url": "",
                                            "anonymous_default_name": "Anonymous",
                                            "max_comment_characters_allowed": "4096",
                                            "max_comment_lines_allowed": "20",
                                            "cooldown_new_comment": "10",
                                            "transparent_spoiler": true,
                                            "enable_flags": false,
                                            "display_exif": false,
                                            "enable_poster_hash": false,
                                            "disable_ghost": false,
                                            "is_nsfw": false,
                                            "hide_thumbnails": false,
                                            "search_enabled": true,
                                            "board_hidden": false,
                                            "archive_full_images": true
                                          },
                                          // ... //
                                        }
                                      }

                                      GET
                                      Boards information

                                      Returns site information and boards

                                      GET /boards/

                                      cURL

                                      curl -X GET "http://archive.4plebs.org/_/api/chan/boards/" \
                                      

                                      Response

                                      {
                                        "site": {
                                          "url": "http://archive.4plebs.org/",
                                          "name": "4plebs",
                                          "title": "4plebs",
                                          "notices": null,
                                          "media_http": [
                                            "http://img.4plebs.org/boards"
                                          ],
                                          "media_https": [
                                            "https://img.4plebs.org/boards"
                                          ],
                                          "global_search_enabled": true
                                        },
                                        "boards": {
                                          "1": {
                                            "name": "4plebs discussion",
                                            "shortname": "plebs",
                                            "board_url": "http://archive.4plebs.org/plebs/",
                                            "threads_per_page": "10",
                                            "original_board_url": "http://archive.4plebs.org/plebs/",
                                            "thumbs_url": "",
                                            "images_url": "",
                                            "anonymous_default_name": "Anonymous",
                                            "max_comment_characters_allowed": "4096",
                                            "max_comment_lines_allowed": "20",
                                            "cooldown_new_comment": "30",
                                            "transparent_spoiler": true,
                                            "enable_flags": false,
                                            "display_exif": false,
                                            "enable_poster_hash": false,
                                            "disable_ghost": false,
                                            "is_nsfw": false,
                                            "hide_thumbnails": false,
                                            "search_enabled": false,
                                            "board_hidden": false,
                                            "internal_board_settings": {
                                              "op_image_upload_necessity": "always",
                                              "thumbnail_op_width": "250",
                                              "thumbnail_op_height": "250",
                                              "thumbnail_reply_width": "125",
                                              "thumbnail_reply_height": "125",
                                              "max_image_size_kilobytes": "10240",
                                              "max_image_size_width": "11000",
                                              "max_image_size_height": "11000",
                                              "max_posts_count": "400",
                                              "max_images_count": "250",
                                              "cooldown_new_thread": "300",
                                              "thread_lifetime": "1728000",
                                              "min_image_repost_time": "1"
                                            }
                                          }
                                        }
                                      }

                                      GET
                                      Intel Share

                                      Returns globally banned media hashes. 100 results per page.

                                      GET /intel/

                                      Required parameters

                                      Name /type

                                      Description /example

                                      Constraints

                                      page
                                      number

                                      Page number

                                      1

                                        cURL

                                        curl -X GET "http://archive.4plebs.org/_/api/chan/intel/?page=1" \
                                        

                                        Response

                                        {
                                          "banned_hashes": [
                                            "//8lBubUDXXu8XPzr/GB1Q==",
                                            "/4h1xkGAwghktHzaxvBHFg==",
                                            "/4p9mjR58I3FtJGa2wkUkQ==",
                                            // ... //
                                          ],
                                          "total_count": "745"
                                        }

                                        POST
                                        Offsite Report

                                        Used for POSTing reports. This will accept request data with multipart/form-data, application/x-www-form-urlencoded or application/json.

                                        POST /offsite_report/

                                        Required parameters

                                        Name /type

                                        Description /example

                                        Constraints

                                        board
                                        string

                                        Board shortname

                                        "plebs"

                                          num
                                          number

                                          Number of the post. This can have _ or , to indicate ghost posts.

                                          1

                                            reason
                                            string

                                            Reason of the report

                                            "report reason"

                                              Optional parameters

                                              Name /type

                                              Description /example

                                              Constraints

                                              access_key
                                              string

                                              Access key given by the admins. This is now only used for setting source IP manually.

                                              "3d86f29c97c98aaca59fd538f19bb532"

                                                ip
                                                string

                                                IP of the reporting client. If not set the calling IP will be used.

                                                "10.10.10.10"

                                                  cURL

                                                  curl -X POST "http://archive.4plebs.org/_/api/chan/offsite_report/" \
                                                       -H "Content-Type: application/json" \
                                                       --data '{"access_key":"3d86f29c97c98aaca59fd538f19bb532","board":"plebs","num":1,"reason":"report reason","ip":"10.10.10.10"}'

                                                  Response

                                                  {
                                                    "success": "You have successfully submitted a report for this post."
                                                  }

                                                  GET
                                                  List articles

                                                  Returns all articles.

                                                  GET /articles/

                                                  cURL

                                                  curl -X GET "http://archive.4plebs.org/_/api/chan/articles/" \
                                                  

                                                  Response

                                                  {
                                                    "0": {
                                                      "id": "2",
                                                      "slug": "credits",
                                                      "title": "Credits & Links",
                                                      "url": "",
                                                      "content": "##Credits\r\nUpdated on Feb 24 2017.   \r\n...",
                                                      "hidden": "0",
                                                      "top": "0",
                                                      "bottom": "1",
                                                      "timestamp": "1487959596"
                                                    },
                                                    "1": {
                                                      "id": "1",
                                                      "slug": "faq",
                                                      "title": "FAQ",
                                                      "url": "",
                                                      "content": "# Frequently asked questions\r\nLast updated on Sep 3 2016.\r\n...",
                                                      "hidden": "0",
                                                      "top": "0",
                                                      "bottom": "1",
                                                      "timestamp": "1476812698"
                                                    },
                                                    "2": {
                                                      "id": "4",
                                                      "slug": "status",
                                                      "title": "Status",
                                                      "url": "http://status.4plebs.org/",
                                                      "content": "",
                                                      "hidden": "0",
                                                      "top": "0",
                                                      "bottom": "1",
                                                      "timestamp": "1426596785"
                                                    },
                                                    "3": {
                                                      "id": "5",
                                                      "slug": "transparency",
                                                      "title": "Transparency",
                                                      "url": "",
                                                      "content": "<h3>Transparency</h3>\r\n<p>Limited ...",
                                                      "hidden": "0",
                                                      "top": "0",
                                                      "bottom": "0",
                                                      "timestamp": "1447098253"
                                                    },
                                                    "4": {
                                                      "id": "3",
                                                      "slug": "twitter",
                                                      "title": "Twitter",
                                                      "url": "https://twitter.com/4plebs",
                                                      "content": "",
                                                      "hidden": "0",
                                                      "top": "0",
                                                      "bottom": "1",
                                                      "timestamp": "1426596754"
                                                    }
                                                  }

                                                  GET
                                                  Return article

                                                  Return one article. Raw markdown in content_raw and formatted html in content_formatted.

                                                  GET /articles/

                                                  Required parameters

                                                  Name /type

                                                  Description /example

                                                  Constraints

                                                  slug
                                                  string

                                                  Slug of the article

                                                  "faq"

                                                    cURL

                                                    curl -X GET "http://archive.4plebs.org/_/api/chan/articles/?slug=faq" \
                                                    

                                                    Response

                                                    {
                                                      "id": "1",
                                                      "slug": "faq",
                                                      "title": "FAQ",
                                                      "url": "",
                                                      "content_raw": "# Frequently asked questions\r\nLast updated on Sep 3 2016.\r\n\r\n### ...",
                                                      "content_formatted": "<h1>Frequently asked questions</h1>\n\n<p>Last updated on Sep 3 2016...",
                                                      "hidden": "0",
                                                      "top": "0",
                                                      "bottom": "1",
                                                      "timestamp": "1476812698"
                                                    }

                                                    GET
                                                    List board statistics

                                                    Returns all enabled board statistics.

                                                    GET /statistics/

                                                    cURL

                                                    curl -X GET "http://archive.4plebs.org/_/api/chan/statistics/" \
                                                    

                                                    Response

                                                    {
                                                      "enabled_statistics": [
                                                        {
                                                          "activity": "Activity"
                                                        },
                                                        {
                                                          "countries": "Countries"
                                                        },
                                                        {
                                                          "image-reposts": "Image Reposts"
                                                        },
                                                        {
                                                          "lthreads": "Largest Threads"
                                                        },
                                                        {
                                                          "new-users": "New Users"
                                                        },
                                                        {
                                                          "population": "Population"
                                                        },
                                                        {
                                                          "post-count": "Post Count"
                                                        },
                                                        {
                                                          "post-rate": "Post Rate"
                                                        },
                                                        {
                                                          "users-online": "Users Online"
                                                        }
                                                      ]
                                                    }

                                                    GET
                                                    Return board statistic data

                                                    Returns data of selected statistic. Timestamp omitted when statistic generated on request.

                                                    GET /statistics/

                                                    Required parameters

                                                    Name /type

                                                    Description /example

                                                    Constraints

                                                    board
                                                    string

                                                    Board short name.

                                                    "adv"

                                                      stat
                                                      string

                                                      Statistic identifier.

                                                      "activity"

                                                        cURL

                                                        curl -X GET "http://archive.4plebs.org/_/api/chan/statistics/?board=adv&stat=activity" \
                                                        

                                                        Response

                                                        {
                                                          "statistic": {
                                                            "name": "Activity",
                                                            "timestamp": "1488379998"
                                                          },
                                                          "data": "..."
                                                        }