The Wetfish Wiki API

Now the wetfish wiki has an API! Pretty cool, right?

Public Endpoints
All of these endpoints can be accessed without authentication. There is currently no rate limiting in place, but please, be reasonable. If too many requests are made too quickly, CloudFlare will probably block you automatically.
  • /api/v1/content
  • This endpoint displays formatted content from a specific page. Useful if you want to embed the content from a page into another.
  • /api/v1/source
  • This endpoint displays the source markup for a specific page. Not sure why you'd need this, but why not?
  • /api/v1/json
  • This endpoint displays a JSON object containing page information. The title, content, tags, modification date, number of page views, and number of edits are included. Title and content are provided in both formatted and source forms.

Each endpoint must be followed by name of the page you are requesting information for. If no page is defined, the home page is displayed by default.


Authorized Endpoints
Certain endpoints require authentication to fetch data. Authentication is currently handled by filling out a captcha, however Wetfish Login integration is planned for the future. These endpoints contain a lot of information and have the potential for abuse, so authentication was put in place to protect our servers.

A credits system has been implemented to allow developers to make multiple requests to authenticated pages before needing to type a captcha again. The login endpoint will add credits to your session and making requests to other endpoints will subtract credits. Once your session reaches zero credits or less, you will be automatically deauthenticated.
  • /api/v1/status
  • This endpoint displays the current status of your session. The 'authed' property determines whether or not you are authorized to make subsequent requests. The 'credits' property is the number of credits you have left to make requests.
  • /api/v1/login
  • This endpoint displays a captcha. When a captcha is entered correctly, your session will be marked as authenticated and you will be granted 10 credits.
  • /api/v1/logout
  • This endpoint will terminate your session, no response is given.
  • /api/v1/pages
  • This endpoint provides a list of every page on the wiki. The 'path' property refers to the URL of the page on the wiki and the 'title' property is the current title of the page.
  • Uses 4 credits per request.
  • /api/v1/tags
  • This endpoint provides a list of every tag on the wiki. The 'tag' property is the name of the tag as it appears in pages, the 'count' property is how many pages the tag has been used on, and the 'views' property is how many times the tag page has been viewed.
  • Uses 4 credits per request.
  • /page/?edit&api=true
  • While not technically an API endpoint, post data can be sent to any page with the parameter "api=true" which will return JSON. The response contains a status code of either 'success' or 'error' with an associated message or an object containing errors.
  • Uses 10 credits per successful page edit.


Examples

Tags: RTFM | Programming | Wetfish | API | Community | Projects