Skip to main content

Official Python SDK for the Friday API

Project description

Friday SDK

Official SDK for the Friday API, available for both Python and JavaScript/TypeScript.

Features

  • LinkedIn Profile Analysis
  • Company Analysis
  • Web Scraping
  • Web Crawling
  • Google Search
  • AI-powered Information Extraction
  • Rate Limit Management

Python SDK

Installation

pip install friday-sdk

Usage

from friday_sdk import FridayClient

# Initialize the client
client = FridayClient(api_key='your-api-key')

# Analyze a LinkedIn profile
profile = client.get_profile('https://www.linkedin.com/in/username')

# Analyze a company
company = client.analyze_company('https://www.linkedin.com/company/companyname')

# Scrape a website
scrape_result = client.scrape(
    'https://example.com',
    formats=['html', 'markdown', 'links']
)

# Crawl a website
crawl_result = client.crawl(
    'https://example.com',
    formats=['html', 'markdown'],
    max_pages=5
)

# Perform a Google search
search_results = client.search(
    'your search query',
    location='US',
    num_results=15
)

# Extract information using AI
extracted_info = client.extract(
    'https://example.com',
    'Extract all pricing information from this page'
)

# Check API status
status = client.get_status()

JavaScript/TypeScript SDK

Installation

npm install friday-sdk
# or
yarn add friday-sdk

Usage

import { FridayClient } from 'friday-sdk';

// Initialize the client
const client = new FridayClient({
  apiKey: 'your-api-key'
});

// Analyze a LinkedIn profile
const profile = await client.getProfile('https://www.linkedin.com/in/username');

// Analyze a company
const company = await client.analyzeCompany('https://www.linkedin.com/company/companyname');

// Scrape a website
const scrapeResult = await client.scrape('https://example.com', {
  formats: ['html', 'markdown', 'links']
});

// Crawl a website
const crawlResult = await client.crawl('https://example.com', {
  formats: ['html', 'markdown'],
  maxPages: 5
});

// Perform a Google search
const searchResults = await client.search('your search query', {
  location: 'US',
  numResults: 15
});

// Extract information using AI
const extractedInfo = await client.extract(
  'https://example.com',
  'Extract all pricing information from this page'
);

// Check API status
const status = await client.get_status();

Error Handling

Both SDKs include proper error handling and will throw exceptions/errors when:

  • The API key is invalid or expired
  • Rate limits are exceeded
  • The API returns an error response
  • Network issues occur

Example error handling in Python:

from friday_sdk import FridayClient
import requests

try:
    client = FridayClient(api_key='your-api-key')
    result = client.get_profile('https://www.linkedin.com/in/username')
except requests.exceptions.HTTPError as e:
    print(f"HTTP error occurred: {e}")
except requests.exceptions.RequestException as e:
    print(f"Network error occurred: {e}")

Example error handling in TypeScript:

try {
  const client = new FridayClient({
    apiKey: 'your-api-key'
  });
  const result = await client.getProfile('https://www.linkedin.com/in/username');
} catch (error) {
  console.error('An error occurred:', error.message);
}

Rate Limits

The API includes rate limiting based on your API key type. You can check your current rate limit status using the get_status() method.

Support

For support, please contact support@friday.dev or visit our documentation at https://docs.friday.dev

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

friday_sdk-0.1.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

friday_sdk-0.1.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file friday_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: friday_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for friday_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 36701bae8bbfd02e8249926c165877dfcec855ef17e43bfc8659bf2c44ec7ccf
MD5 65d8a21fad709b7433c5fecca207ac51
BLAKE2b-256 2257aa2005757d14e0167d54b9122d18af5746c605b73b06ef94f46fa9d023b5

See more details on using hashes here.

File details

Details for the file friday_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: friday_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.8

File hashes

Hashes for friday_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b2932c299ba1cbaec536cd1d41f2a7bd6efd5b20c7180298905d3f2a5c7e320
MD5 aadb7bd7105983d265f97a12479080e9
BLAKE2b-256 6941009ec5e5590f822f09c1041d908d8007bf92968b1a53264ebb20bf31cdb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page