मंगाकथा

खुला एपीआई

पूरी लाइब्रेरी सबके लिए खुली है। कोई चाबी नहीं, कोई लॉगिन नहीं। किसी भी दूसरे प्रोजेक्ट से सीधे ये एंडपॉइंट इस्तेमाल कीजिए। हर जवाब में क्रॉस ऑरिजिन खुला रखा गया है।

GET /api/public/library

पूरी लाइब्रेरी, हर कहानी के साथ उसके सारे पार्ट और डाउनलोड लिंक।

GET /api/public/story/:storyId

एक कहानी की पूरी जानकारी और उसके पार्ट की सूची।

GET /api/public/part/:partId?format=json

एक पार्ट की पूरी कहानी जेसन में।

GET /api/public/part/:partId?format=txt

एक पार्ट की पूरी कहानी सादी टेक्स्ट फाइल में, सीधे डाउनलोड के लिए।

उदाहरण

const res = await fetch("https://your-site/api/public/library");
const { stories } = await res.json();

const part = stories[0].parts[0];
const text = await fetch("https://your-site" + part.text_url + "?format=txt").then(r => r.text());