Greasy Fork is available in English.

PawchiveAPI

The `PawchiveAPI` class provides a simple and efficient way to interact with the Pawchive API.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey, Greasemonkey of Violentmonkey.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Violentmonkey.

Voor het installeren van scripts heb je een extensie nodig, zoals Tampermonkey of Userscripts.

Voor het installeren van scripts heb je een extensie nodig, zoals {tampermonkey_link:Tampermonkey}.

Voor het installeren van scripts heb je een gebruikersscriptbeheerder nodig.

(Ik heb al een user script manager, laat me het downloaden!)

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een extensie nodig, zoals {stylus_link:Stylus}.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

Voor het installeren van gebruikersstijlen heb je een gebruikersstijlbeheerder nodig.

(Ik heb al een beheerder - laat me doorgaan met de installatie!)

Maker
Beginner[2023]
Dagelijks aantal installaties
1
Totaal aantal installaties
3
Beoordelingen
0 0 0
Versie
1.0.4a
Gemaakt op
14-08-2026
Bijgewerkt op
14-08-2026
Grootte
6,61 KB
Licentie
MIT
Wordt toegepast op
Alle websites

PawchiveAPI

The PawchiveAPI JavaScript library provides a clean, simple, and efficient wrapper for interacting with the Pawchive API. Designed specifically for UserScripts and web applications, it supports direct global access (window.PawchiveAPI / globalThis.PawchiveAPI), making it seamless to import via @require or dynamic script loaders.


🚀 Key Features

  • CORS Policy Bypass: Utilizes Tampermonkey's GM_xmlhttpRequest and @connect permissions to securely bypass CORS restrictions when fetching data from the server.
  • Smart Response Parser: Automatically detects and parses JSON responses while gracefully handling plain text outputs (such as raw string responses like "custom"), preventing parsing errors.
  • Global & UnsafeWindow Support: Exported to unsafeWindow, window, and globalThis for maximum compatibility and smooth debugging in browser developer consoles.
  • Flexible Initialization: Easily set custom Base URLs, default HTTP headers, and toggle built-in debug logging.
  • URL Parameter Builder: Automatically formats complex query parameters for search and pagination.

🛠️ Installation & Import

Method 1: Using Tampermonkey @require (Recommended)

Add the following directive to your UserScript Header:


// @require https://greasyfork.org/scripts/591303-pawchiveapi/code/PawChiveAPI.user.js

Method 2: Dynamic Import

const APIClass = window.PawchiveAPI || window.pawchiveAPI;
const api = new APIClass();

📖 Available Methods

🔹 Creators & Profiles

  • getCreators() - Fetches a list of available creators.
  • getCreatorProfile(service, creatorId) - Gets detailed profile info for a creator.
  • getCreatorLinks(service, creatorId) - Retrieves social/external links associated with a creator.
  • getCreatorAnnouncements(service, creatorId) - Fetches announcements made by a creator.
  • getCreatorFancards(service, creatorId) - Gets fancards for a specific creator.

🔹 Posts & Revisions

  • getRecentPosts(params) - Fetches recent posts with optional query parameters (e.g., { limit: 10 }).
  • getCreatorPosts(service, creatorId, params) - Gets posts from a specific creator.
  • getPost(service, creatorId, postId) - Fetches details of a specific post.
  • getPostRevisions(service, creatorId, postId) - Retrieves revision history for a post.
  • getPostComments(service, creatorId, postId) - Fetches user comments on a post.

🔹 Moderation & Flags

  • flagPost(service, creatorId, postId) - Flags a post for review.
  • checkPostFlagged(service, creatorId, postId) - Checks whether a post has already been flagged.

🔹 Account & Favorites

  • getAccountFavorites() - Fetches the current user's favorite posts and creators.
  • addFavoritePost(service, creatorId, postId) - Adds a post to favorites.
  • removeFavoritePost(service, creatorId, postId) - Removes a post from favorites.
  • addFavoriteCreator(service, creatorId) - Adds a creator to favorites.
  • removeFavoriteCreator(service, creatorId) - Removes a creator from favorite

🔹 System

  • getAppVersion() - Fetches the current backend API version.

💻 Usage Example

// Initialize the API client (Debug logs enabled by default)
const api = new PawchiveAPI();

// Fetch recent posts using Async/Await
async function loadContent() {
    try {
        const posts = await api.getRecentPosts();
        console.log('Recent Posts:', posts);

        const creators = await api.getCreators();
        console.log('Creators:', creators);
    } catch (error) {
        console.error('Failed to fetch data from Pawchive API:', error);
    }
}

loadContent();

📜 License

Distributed under the MIT License. Free to use and modify in personal projects and UserScripts.