npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

arase

v1.3.0

Published

Official SDK for ARASE - AI-powered search engine API with stocks and weather

Downloads

436

Readme

ARASE SDK

المكتبة الرسمية لـ ARASE - محرك البحث الذكي بالذكاء الاصطناعي.

Official JavaScript/TypeScript SDK for ARASE - AI-powered search engine API.

Installation | التثبيت

npm install arase
# or
yarn add arase
# or
pnpm add arase

Quick Start | البداية السريعة

Option 1: Environment Variable (Recommended) | الخيار 1: متغير البيئة (مستحسن)

# .env file | ملف .env
ARASE_API_KEY=arase_YOUR_API_KEY
import { AraseClient } from "arase";

// Automatically reads from ARASE_API_KEY environment variable
// يقرأ تلقائياً من متغير البيئة ARASE_API_KEY
const client = new AraseClient();

const results = await client.search("ما هي رؤية السعودية 2030؟");
console.log(results);

Option 2: Direct API Key | الخيار 2: مفتاح API مباشر

import { AraseClient } from "arase";

const client = new AraseClient({ apiKey: "arase_YOUR_API_KEY" });

const results = await client.search("What is Saudi Vision 2030?");
console.log(results);

Environment Variables | متغيرات البيئة

| Variable | Description | الوصف | | ---------------- | ------------------------- | -------------------------- | | ARASE_API_KEY | Your API key (required) | مفتاح API الخاص بك (مطلوب) | | ARASE_BASE_URL | Custom API URL (optional) | رابط API مخصص (اختياري) |

Features | الميزات

Web Search | بحث الويب

const results = await client.search("أفضل المطاعم في الرياض", {
  includeAnswer: true, // إجابة AI
  maxResults: 10,
});

console.log(results.answer); // الإجابة
console.log(results.results); // النتائج

Image Search | بحث الصور

const images = await client.searchImages("برج المملكة الرياض");
console.log(images.images);

News Search | بحث الأخبار

const news = await client.searchNews("أخبار السعودية اليوم");
console.log(news.news);

Places Search | بحث الأماكن

const places = await client.searchPlaces("مقاهي قريبة", {
  userLocation: { lat: 24.7136, lng: 46.6753 }, // الرياض
});
console.log(places.places);

Academic Search | بحث أكاديمي

const papers = await client.searchScholar("artificial intelligence");
console.log(papers.scholar);

Stock Market Search | بحث سوق الأسهم

// Basic stock search | بحخ بسيط
const stocks = await client.search("كم سعر سهم أرامكو؟", {
  includeStocks: true,
});

if (stocks.stocks) {
  stocks.stocks.results.forEach((stock) => {
    console.log(`${stock.name}: ${stock.price} ${stock.currency}`);
    console.log(`Change: ${stock.changePercent}%`);
  });
}

// With AI summary (+1 request) | مع ملخص AI (+1 طلب)
const stocksWithSummary = await client.search("Compare Aramco vs Al Rajhi", {
  includeStocks: true,
  options: {
    stocks: {
      summary: true,
    },
  },
});

console.log(stocksWithSummary.stocks?.summary);

Weather Search | بحث الطقس

// Basic weather | طقس بسيط
const weather = await client.search("الطقس في جدة", {
  includeWeather: true,
});

if (weather.weather) {
  const { location, current, forecast } = weather.weather;
  console.log(`${location.name}: ${current.tempC}°C, ${current.condition}`);

  // Forecast | التوقعات
  forecast.forEach((day) => {
    console.log(`${day.date}: ${day.mintempC}°C - ${day.maxtempC}°C`);
  });
}

// With AI summary and advice (+1 request) | مع ملخص ونصائح AI
const weatherWithSummary = await client.search("Weather in Riyadh", {
  includeWeather: true,
  options: {
    weather: {
      summary: true,
    },
  },
});

console.log(weatherWithSummary.weather?.summary);
console.log(weatherWithSummary.weather?.advice);

Content Extraction | استخراج المحتوى

const content = await client.extract("https://example.com/article", {
  includeSummary: true,
});
console.log(content.content);
console.log(content.summary);

Advanced Options | خيارات متقدمة

const results = await client.search("query", {
  searchDepth: "deep", // basic | advanced | deep
  maxResults: 20,
  includeAnswer: true,
  includeImages: true,
  includeVideos: true,
  includeNews: true,
  includePlaces: true,
  includeShopping: true,
  includeScholar: true,
  includeStocks: true, // 🆕 Stock market data
  includeWeather: true, // 🆕 Weather forecasts
  topic: "general", // general | news | academic
  maxSteps: 3, // للبحث العميق

  // Optional AI summaries | ملخصات AI اختيارية
  options: {
    stocks: {
      summary: true, // +1 request | +1 طلب
    },
    weather: {
      summary: true, // +1 request | +1 طلب
    },
  },
});

Error Handling | معالجة الأخطاء

import { AraseClient, AraseAPIError } from "arase";

try {
  const results = await client.search("query");
} catch (error) {
  if (error instanceof AraseAPIError) {
    console.error(`Error ${error.code}: ${error.message}`);
    console.error(`Status: ${error.status}`);
  }
}

TypeScript Support

Full TypeScript support with exported types:

import type {
  SearchOptions,
  SearchResponse,
  SearchResult,
  ImageResult,
  StockResult, // 🆕 New: Stock data types
  StocksResponse, // 🆕 New: Stock response
  WeatherForecast, // 🆕 New: Weather forecast
  WeatherResponse, // 🆕 New: Weather response
  // ... etc
} from "arase";

Links | روابط

License

MIT