Skip to main content

ARASE Python SDK

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

Official Python SDK for ARASE - AI-powered search engine API.

Installation | التثبيت

pip install arase-sdk

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

# .env file | ملف .env
ARASE_API_KEY=arase_YOUR_API_KEY
from arase import AraseClient

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

results = client.search("ما هي رؤية السعودية 2030؟")
print(results.answer)

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

from arase import AraseClient

client = AraseClient(api_key="arase_YOUR_API_KEY")

results = client.search("What is Saudi Vision 2030?")
print(results.answer)

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

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

Features | الميزات

Web Search | بحث الويب

results = client.search("أفضل المطاعم في الرياض", include_answer=True)

print(results.answer)   # AI-generated answer | إجابة AI
print(results.results)  # Web results | نتائج الويب

Image Search | بحث الصور

results = client.search_images("برج المملكة الرياض")
for image in results.images:
    print(image.image_url)

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

results = client.search_news("أخبار السعودية اليوم")
for article in results.news:
    print(f"{article.title} - {article.source}")

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

# Search near Riyadh | البحث قرب الرياض
results = client.search_places(
    "مقاهي قريبة",
    user_location={"lat": 24.7136, "lng": 46.6753}
)
for place in results.places:
    print(f"{place.title} - {place.rating}⭐")

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

results = client.search_scholar("artificial intelligence")
for paper in results.scholar:
    print(f"{paper.title} ({paper.year}) - {paper.citations} citations")

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

# Basic stock search | بحث بسيط
stocks = client.search(
    "كم سعر سهم أرامكو؟",
    include_stocks=True,
)

if stocks.stocks:
    for stock in stocks.stocks.results:
        print(f"{stock.name}: {stock.price} {stock.currency}")
        print(f"Change: {stock.change_percent}%")

# With AI summary (+1 request) | مع ملخص AI (+1 طلب)
stocks_with_summary = client.search(
    "Compare Aramco vs Al Rajhi",
    include_stocks=True,
    options={
        "stocks": {
            "summary": True
        }
    },
)

print(stocks_with_summary.stocks.summary)

Weather Search | بحث الطقس

# Basic weather | طقس بسيط
weather = client.search(
    "الطقس في جدة",
    include_weather=True,
)

if weather.weather:
    location = weather.weather.location
    current = weather.weather.current
    print(f"{location['name']}: {current['temp_c']}°C, {current['condition']}")

    # Forecast | التوقعات
    for day in weather.weather.forecast:
        print(f"{day.date}: {day.mintemp_c}°C - {day.maxtemp_c}°C")

# With AI summary and advice (+1 request) | مع ملخص ونصائح AI
weather_with_summary = client.search(
    "Weather in Riyadh",
    include_weather=True,
    options={
        "weather": {
            "summary": True
        }
    },
)

print(weather_with_summary.weather.summary)
print(weather_with_summary.weather.advice)

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

content = client.extract(
    "https://example.com/article",
    include_summary=True
)
print(content.content)
print(content.summary)

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

from arase import AraseClient, SearchOptions

client = AraseClient()

# Using SearchOptions | استخدام SearchOptions
options = SearchOptions(
    search_depth="deep",      # basic | advanced | deep
    max_results=20,
    include_answer=True,
    include_images=True,
    include_videos=True,
    include_news=True,
    include_places=True,
    include_shopping=True,
    include_scholar=True,
    include_stocks=True,      # 🆕 Stock market data
    include_weather=True,     # 🆕 Weather forecasts
    topic="general",          # general | news | academic
    max_steps=3,              # For deep search | للبحث العميق

    # Optional AI summaries | ملخصات AI اختيارية
    options={
        "stocks": {
            "summary": True  # +1 request | +1 طلب
        },
        "weather": {
            "summary": True  # +1 request | +1 طلب
        },
    },
)

results = client.search("query", options=options)

# Or use keyword arguments | أو استخدم الكلمات المفتاحية
results = client.search(
    "query",
    include_answer=True,
    max_results=10,
)

Async Support | دعم Async

import asyncio
from arase import AsyncAraseClient

async def main():
    async with AsyncAraseClient() as client:
        results = await client.search("query", include_answer=True)
        print(results.answer)

asyncio.run(main())

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

from arase import AraseClient, AraseAPIError

client = AraseClient()

try:
    results = client.search("query")
except AraseAPIError as e:
    print(f"Error {e.code}: {e.message}")
    print(f"Status: {e.status}")

Context Manager | مدير السياق

from arase import AraseClient

# Automatically closes connection | يغلق الاتصال تلقائياً
with AraseClient() as client:
    results = client.search("query")
    print(results.answer)

Type Hints | تلميحات الأنواع

Full type hints support for better IDE experience:

from arase import (
    AraseClient,
    SearchOptions,
    SearchResponse,
    SearchResult,
    ImageResult,
    StockResult,        # 🆕 New: Stock data types
    StocksResponse,     # 🆕 New: Stock response
    WeatherForecast,    # 🆕 New: Weather forecast
    WeatherResponse,    # 🆕 New: Weather response
    # ... etc
)

License

MIT

Metadata

Release files for arase-sdk 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arase-sdk 1.3.0
File Size Uploaded Provenance Actions
arase_sdk-1.3.0.tar.gz 13.1 kB Without provenance Details for arase_sdk-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for arase-sdk 1.3.0
File Interpreter ABI Platform Actions
arase_sdk-1.3.0-py3-none-any.whl Python 3 none any Details for arase_sdk-1.3.0-py3-none-any.whl

Total release size: 27.4 kB

Release files / arase_sdk-1.3.0.tar.gz

Download URL arase_sdk-1.3.0.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7adc53476f3a9b6cff0b753d00637f5f5f9a5a973d140d47b6315fe753577b2a
BLAKE2b-256 checksum
How to use checksums
cf56f7daad77bb3343980d5430af1564e8a9934482e4a95187d0c6f6a571399e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Release files / arase_sdk-1.3.0-py3-none-any.whl

Download URL arase_sdk-1.3.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54d912ec9ff54d67b080c329022001024f098dbcc22a7cf8bf197e9d78aa3bf1
BLAKE2b-256 checksum
How to use checksums
580dac12a4bc66d593bc2519bc8861249298a2732b265cc81370664a96054092
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Security for arase-sdk 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page