Catalog npm
PACKAGE EXPLORERView in registry

4get-sdk

npm

Fully typed TypeScript SDK for the 4get search engine API

4getscrapersdksearchtypescript
Versions collected4
Direct dependencies1From release 0.2.1
Last observed20 Oct, 20:09 UTC

README

Current package documentation

4get SDK

Fully typed TypeScript SDK for the 4get search engine API. Zero runtime dependencies — uses native fetch.

Install

npm install 4get-sdk

Requires Node 18+ (or any runtime with fetch).

Usage

import { FgetClient } from "4get-sdk";

const client = new FgetClient("https://4get.ca");

const results = await client.web({ s: "higurashi", extendedsearch: true });
for (const hit of results.web) {
  console.log(hit.title, hit.url);
}

// Next page — npt alone suffices, do not resend `s`
const page2 = await client.web({ npt: results.npt! });

const pics = await client.images({ s: "higurashi", nsfw: "no" });
const clips = await client.videos({ s: "higurashi", sort: "upload_date" });
const headlines = await client.news({ s: "higurashi" });
const tunes = await client.music({ s: "higurashi", type: "track" });
const suggestions = await client.autocomplete("higurashi");

const meta = await client.ami4get(); // instance info, version, instance list

Pass tokens

Instances with bot protection require a pass cookie (from solving the captcha):

const client = new FgetClient("https://4get.ca", "your-token");

URL helpers

client.favicon("https://lolcat.ca");                        // /favicon?s=...
client.proxy("https://example.com/pic.png", "square");      // /proxy?i=...&s=square
client.audioUrl("sc", "https://api-v2.soundcloud.com/..."); // /audio/sc?s=...

For audio proxying, honor SongResult.stream.endpoint: "linear" (or null) means a plain HTTP stream; anything else must be proxied via audioUrl.

API

All search responses are typed (WebResponse, ImagesResponse, VideosResponse, NewsResponse, MusicResponse). Every response carries status (throws FgetError unless "ok") and npt (pagination token, null when no more pages). Most fields can be null — the types reflect that.

Test

npm test   # runs against $FGET_INSTANCE (default http://localhost:8888)

Terms of use

Respect the 4get API terms — cache responses, don't scrape intensively, and don't use it for SERP SEO.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 4

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.1Registry latest13 Aug 20261
0.2.012 Aug 20261
0.1.112 Aug 20261
0.1.010 Aug 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
mirere-ts/4get-sdk

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:09 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:5e0f40f41bc78e44a71f456b8c10e42556ab776f4b82ec288c5181fc2dc3ca28