Help: API
← Wiki Home – API
Contents: Source Code | Database Exports | Documentation
Source Code
Our source code is a modified version of E621's code. Its primary language is ruby, and its framework is rails.
You can find out source code here: https://github.com/FemboyFans/FemboyFans
You can find E621's source code here: https://github.com/e621ng/e621ng
Database Exports
We generate exports of many site features daily. They are generated some time after 2AM UTC.
Exports can be found in an xz compressed csv here: https://femboy.fan/db_exports
These exports can contain every edge case CSV can offer. Ensure your parser can handle embedded newlines and other edge cases.
Included in the exports is all of these:
- Artists
- id, name, creator_id, created_at, updated_at, other_names, linked_user_id, is_locked
- Artist Versions
- id, artist_id, name, updater_id, created_at, updated_at, other_names, urls, notes_changed
- Bulk Update Requests
- id, creator_id, forum_topic_id, script, status, created_at, updated_at, approver_id, forum_post_id, title
- Notes
- id, creator_id, post_id, x, y, width, height, body, created_at, updated_at, version
- Note Versions
- id, note_id, post_id, updater_id, x, y, width, height, is_active, body, created_at, updated_at, version
- Pools
- id, name, creator_id, description, is_active, post_ids, created_at, updated_at, artist_names
- Pool Versions
- id, pool_id, post_ids, added_post_ids, removed_post_ids, updater_id, description, description_changed, name, name_changed, created_at, updated_at, is_active, version
- Posts
- id, created_at, updated_at, up_score, down_score, score, source, md5, rating, is_note_locked, is_rating_locked, is_status_locked, is_pending, is_flagged, is_deleted, uploader_id, approver_id, last_noted_at, last_comment_bumped_at, fav_count, tag_string, tag_count, tag_count_general, tag_count_artist, tag_count_character, tag_count_copyright, file_ext, file_size, image_width, image_height, parent_id, has_children, last_commented_at, has_active_children, tag_count_meta, tag_count_species, tag_count_invalid, description, change_seq, tag_count_lore, bg_color, duration, framecount, thumbnail_frame, original_tag_string, tag_count_voice_actor, tag_count_gender, qtags, upload_url
- Post Versions
- id, post_id, tags, added_tags, removed_tags, locked_tags, added_locked_tags, removed_locked_tags, updater_id, updated_at, rating, rating_changed, parent_id, parent_changed, source, source_changed, description, description_changed, version, reason, original_tags
- Tags
- id, name, post_count, category, related_tags, related_tags_updated_at, created_at, updated_at, is_locked
- Tag Aliases
- id, antecedent_name, consequent_name, creator_id, forum_topic_id, status, created_at, updated_at, post_count, approver_id, forum_post_id, reason
- Tag Implications
- id, antecedent_name, consequent_name, creator_id, forum_topic_id, status, created_at, updated_at, approver_id, forum_post_id, descendant_names, reason
- Tag Versions
- id, created_at, updated_at, category, is_locked, tag_id, updater_id, reason
- Users
- wiki_page_version_count, artist_version_count, pool_version_count, forum_post_count, comment_count, favorite_count, positive_feedback_count, neutral_feedback_count, negative_feedback_count, profile_about, profile_artinfo, id, created_at, name, level, base_upload_limit, post_upload_count, post_update_count, note_update_count, avatar_id, can_approve_posts, unrestricted_uploads, disable_user_dmails, can_manage_aibur
- Wiki Pages
- id, creator_id, title, body, is_locked, created_at, updated_at, updater_id, parent
- Wiki Page Versions
- id, wiki_page_id, updater_id, title, body, is_locked, created_at, updated_at, reason, parent
Documentation
Api Keys
You can manage your api keys here: https://femboy.fan/api_keys. Here you can select a subset of ip addresses and permissions the key is allowed to be used on.
Each route has an identifier, /posts/1234.json for instance is posts:show. You can find any route's identifier by making a GET request to /route.json?url=<url>&method=<method?
JS Example
const url = "/posts.json"; const method = "GET"; const response = await fetch(`https://femboy.fan/route?url=${url}&method=${method}`); console.log(await response.json());
This returns a json with various properties, but the api property is the only important one. That property is the identifier for the provided route.
User Agents
A non-empty User-Agent header is required for all requests. Please pick a descriptive User-Agent for your project.
You are encouraged to include your username, so that you may be contacted if your project causes problems.
For example: MyProject/1.0.0 (username)
Important!
Do not impersonate a browser user agent, as this will get you blocked.
In some cases, you may be unable to set a custom header for your requests.
This may be because you are creating a userscript, a browser extension, or otherwise something that works within a browser.
If that is the case, please attach an additional url quest parameter named _client, and set it to your user-agent.
Authorization
An api keys is required for authorization. See Api Keys.
Authorization is required for any routes that modify or delete data, or fetch sensitive data.
Authorization should be done via basic authentication in the Authorization header.
JS Example
const username = "foxy"; const apiKey = "1234abcd"; const response = await fetch("https://femboy.fan/posts.json", { headers: { "Authorization": "Basic " + btoa(`${username}:${apiKey}`) } }); console.log(await response.json());
Should you be unable to set headers, you can set the login & api_key parameters.
Example: https://femboy.fan/posts.json?login=foxy&api_key=1234abcd
Endpoints
A full list of endpoints can be found at https://femboy.fan/api.
The openapi spec can be found on our github: https://github.com/FemboyFans/FemboyFans/blob/master/openapi.yaml