4plebs.org API Documentation v0.0.2

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": "{\u0022FileName\u0022:\u0022d4c564ed648381f49af029c9443de206.jpg\u0022,\u0022FileDateTime\u0022:1366825827,\u0022FileSize\u0022:51338,\u0022FileType\u0022:2,\u0022MimeType\u0022:\u0022image\\\/jpeg\u0022,\u0022SectionsFound\u0022:\u0022\u0022,\u0022COMPUTED\u0022:{\u0022html\u0022:\u0022width=\\\u0022645\\\u0022 height=\\\u0022773\\\u0022\u0022,\u0022Height\u0022:773,\u0022Width\u0022:645,\u0022IsColor\u0022: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_post|by_thread|ghost

              "by_post"

                cURL

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

                Response

                {
                  "1148": {
                    "omitted": 0,
                    "images_omitted": 0,
                    "op": {
                      // post object //
                    },
                    "posts": [
                      // post objects //
                    ]
                  },
                  "1145": {
                    "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. Do not specify for desc.

                          "asc"

                            ghost
                            string

                            Possible values: only|none.

                            "none"

                              uid
                              string

                              ""

                                tripcode
                                string

                                ""

                                  username
                                  string

                                  ""

                                    country
                                    string

                                    ""

                                      results
                                      string

                                      Results grouped by thread or none. Possible value: thread

                                      ""

                                        filter
                                        string

                                        Possible values: image|text

                                        "image"

                                          deleted
                                          string

                                          Possible values: deleted|not-deleted.

                                          "not-deleted"

                                            type
                                            string

                                            Possible values sticky|op|posts.

                                            "posts"

                                              end
                                              string

                                              End date. Format: YYYY-MM-DD.

                                              ""

                                                image
                                                string

                                                Base64 encoded md5 hash of media file.

                                                ""

                                                  email
                                                  string

                                                  ""

                                                    capcode
                                                    string

                                                    Possible values: user|mod|dev|admin.

                                                    "user"

                                                      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 requests 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/" \
                                                                       --header "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."}