New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

desearch-js

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

desearch-js

Desearch SDK for the Node.js

latest
Source
npmnpm
Version
1.3.0
Version published
Weekly downloads
1.4K
-3.49%
Maintainers
1
Weekly downloads
 
Created
Source

Desearch

The official JavaScript SDK for the Desearch API - AI-driven search, web crawling, and X (Twitter) data extraction.

Table of Contents

Installation

npm install desearch-js

Quick Start

import Desearch from "desearch-js";

const desearch = new Desearch("your-api-key");

// Perform an AI-powered search
desearch
  .aiSearch({
    prompt: "Latest developments in AI",
    tools: ["web", "twitter", "reddit"],
  })
  .then((response) => {
    console.log(response);
  });

aiSearch

AI-powered multi-source contextual search. Searches across web, X (Twitter), Reddit, YouTube, HackerNews, Wikipedia, and arXiv and returns results with optional AI-generated summaries.

ParameterTypeRequiredDefaultDescription
promptstringYesSearch query prompt
tools(ToolEnum | string)[]YesA list of tools to be used for the search
start_datestring | nullNonullThe start date for the search query (YYYY-MM-DDTHH:MM:SSZ)
end_datestring | nullNonullThe end date for the search query (YYYY-MM-DDTHH:MM:SSZ)
date_filterDateFilterEnum | nullNo'PAST_24_HOURS'Predefined date filter for search results
result_typeResultTypeEnum | nullNo'LINKS_WITH_FINAL_SUMMARY'The result type for the search
system_messagestring | nullNo''System message for the search
scoring_system_messagestring | nullNonullSystem message for scoring the response
countnumber | nullNo10Number of results per source (10–200)
desearch
  .aiSearch({
    prompt: "Bittensor",
    tools: ["web", "hackernews", "reddit", "wikipedia", "youtube", "twitter", "arxiv"],
    date_filter: "PAST_24_HOURS",
    result_type: "LINKS_WITH_FINAL_SUMMARY",
    count: 20,
  })
  .then((result) => {
    console.log(result);
  });

aiWebLinksSearch

Search for raw links across web sources (web, HackerNews, Reddit, Wikipedia, YouTube, arXiv). Returns structured link results without AI summaries.

ParameterTypeRequiredDefaultDescription
promptstringYesSearch query prompt
tools(WebToolEnum | string)[]YesList of tools to search with
countnumber | nullNo10Number of results per source (10–200)
desearch
  .aiWebLinksSearch({
    prompt: "What are the recent sport events?",
    tools: ["web", "hackernews", "reddit", "wikipedia", "youtube", "arxiv"],
    count: 20,
  })
  .then((result) => {
    console.log(result);
  });

aiXLinksSearch

Search for X (Twitter) post links matching a prompt using AI-powered models. Returns tweet objects from the miner network.

ParameterTypeRequiredDefaultDescription
promptstringYesSearch query prompt
countnumber | nullNo10Number of results per source (10–200)
desearch
  .aiXLinksSearch({
    prompt: "What are the recent sport events?",
    count: 20,
  })
  .then((result) => {
    console.log(result);
  });

xSearch

X (Twitter) search with extensive filtering options: date range, user, language, verification status, media type (image/video/quote), and engagement thresholds (min likes, retweets, replies). Sort by Top or Latest.

ParameterTypeRequiredDefaultDescription
querystringYesAdvanced search query
sortstring | nullNo'Top'Sort by Top or Latest
userstring | nullNonullUser to search for
start_datestring | nullNonullStart date in UTC (YYYY-MM-DD)
end_datestring | nullNonullEnd date in UTC (YYYY-MM-DD)
langstring | nullNonullLanguage code (e.g., en, es, fr)
verifiedboolean | nullNonullFilter for verified users
blue_verifiedboolean | nullNonullFilter for blue checkmark verified users
is_quoteboolean | nullNonullInclude only tweets with quotes
is_videoboolean | nullNonullInclude only tweets with videos
is_imageboolean | nullNonullInclude only tweets with images
min_retweetsnumber | string | nullNonullMinimum number of retweets
min_repliesnumber | string | nullNonullMinimum number of replies
min_likesnumber | string | nullNonullMinimum number of likes
countnumber | nullNo20Number of tweets to retrieve (1–100)
desearch
  .xSearch({
    query: "Whats going on with Bittensor",
    sort: "Top",
    user: "elonmusk",
    start_date: "2024-12-01",
    end_date: "2025-02-25",
    lang: "en",
    verified: true,
    blue_verified: true,
    count: 20,
  })
  .then((result) => {
    console.log(result);
  });

Fetch Posts by URLs

xPostsByUrls

Fetch full post data for a list of X (Twitter) post URLs. Returns metadata, content, and engagement metrics for each URL.

ParameterTypeRequiredDefaultDescription
urlsstring[]YesList of post URLs to retrieve
desearch
  .xPostsByUrls({
    urls: ["https://x.com/RacingTriple/status/1892527552029499853"],
  })
  .then((result) => {
    console.log(result);
  });

Retrieve Post by ID

xPostById

Fetch a single X (Twitter) post by its unique ID. Returns metadata, content, and engagement metrics.

ParameterTypeRequiredDefaultDescription
idstringYesThe unique ID of the post
desearch
  .xPostById({
    id: "1892527552029499853",
  })
  .then((result) => {
    console.log(result);
  });

Search X Posts by User

xPostsByUser

Search X (Twitter) posts by a specific user, with optional keyword filtering.

ParameterTypeRequiredDefaultDescription
userstringYesUser to search for
querystringNo''Advanced search query
countnumberNo10Number of tweets to retrieve (1–100)
desearch
  .xPostsByUser({
    user: "elonmusk",
    query: "Whats going on with Bittensor",
    count: 20,
  })
  .then((result) => {
    console.log(result);
  });

Get Retweeters of a Post

xPostRetweeters

Retrieve the list of users who retweeted a specific post by its ID. Supports cursor-based pagination.

ParameterTypeRequiredDefaultDescription
idstringYesThe ID of the post to get retweeters for
cursorstring | nullNonullCursor for pagination
desearch
  .xPostRetweeters({
    id: "1982770537081532854",
  })
  .then((result) => {
    console.log(result);
  });

Get X Posts by Username

xUserPosts

Retrieve a user's timeline posts by their username. Fetches the latest tweets posted by that user. Supports cursor-based pagination.

ParameterTypeRequiredDefaultDescription
usernamestringYesUsername to fetch posts for
cursorstring | nullNonullCursor for pagination
desearch
  .xUserPosts({
    username: "elonmusk",
  })
  .then((result) => {
    console.log(result);
  });

Fetch User's Tweets and Replies

xUserReplies

Fetch tweets and replies posted by a specific user, with optional keyword filtering.

ParameterTypeRequiredDefaultDescription
userstringYesThe username of the user to search for
countnumberNo10The number of tweets to fetch (1–100)
querystringNo''Advanced search query
desearch
  .xUserReplies({
    user: "elonmusk",
    count: 20,
    query: "latest news on AI",
  })
  .then((result) => {
    console.log(result);
  });

Retrieve Replies for a Post

xPostReplies

Fetch replies to a specific X (Twitter) post by its post ID.

ParameterTypeRequiredDefaultDescription
post_idstringYesThe ID of the post to search for
countnumberNo10The number of tweets to fetch (1–100)
querystringNo''Advanced search query
desearch
  .xPostReplies({
    post_id: "1234567890",
    count: 20,
    query: "latest news on AI",
  })
  .then((result) => {
    console.log(result);
  });

xTrends

Retrieve trending topics on X for a given location using its WOEID (Where On Earth ID).

ParameterTypeRequiredDefaultDescription
woeidnumberYesThe WOEID of the location (e.g. 23424977 for United States)
countnumber | nullNo30The number of trends to return (30–100)
desearch
  .xTrends({
    woeid: 23424977,
    count: 20,
  })
  .then((result) => {
    console.log(result);
  });

webSearch

SERP web search. Returns paginated web search results, replicating a typical search engine experience.

ParameterTypeRequiredDefaultDescription
querystringYesThe search query string
startnumberNo0How many results to skip for pagination (0, 10, 20, etc.)
desearch
  .webSearch({
    query: "latest news on AI",
    start: 10,
  })
  .then((result) => {
    console.log(result);
  });

Crawl a URL

webCrawl

Crawl a URL and return its content as plain text or HTML.

ParameterTypeRequiredDefaultDescription
urlstringYesURL to crawl
format'html' | 'text'No'text'Format of the content to be returned
desearch
  .webCrawl({
    url: "https://en.wikipedia.org/wiki/Artificial_intelligence",
    format: "html",
  })
  .then((result) => {
    console.log(result);
  });

Keywords

desearch

FAQs

Package last updated on 06 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts