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.0.tar.gz (2.6 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.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: friday_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 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.0.tar.gz
Algorithm Hash digest
SHA256 652aeffa72e8615d22418fabb99ad752383af63730ad341ad1503733fa2dc919
MD5 2261ba7c411beb1895601a1d6fa4514c
BLAKE2b-256 df46b6201ffad5f15459666109f493515434aac69e3bfb1784698ff2fd4d6e66

See more details on using hashes here.

File details

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

File metadata

  • Download URL: friday_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89d7162388d4205dddb012c0fab5858a5236045169fdc63ce07975a6d0ad38fb
MD5 81d6e45f2e497f188cc75f1de6d4694e
BLAKE2b-256 8f759fe71c1b21838f9691b0a90d39c107273fb883f252ff26db86dcb84e4d89

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