friday-sdk
Version:
Official JavaScript/TypeScript SDK for the Friday API
58 lines (57 loc) • 1.99 kB
TypeScript
interface ApiResponse<T = any> {
data: T;
error?: string;
}
export declare class FridayClient {
private apiKey;
private baseUrl;
/**
* Initialize the Friday API client.
* @param apiKey - Your Friday API key
* @param baseUrl - Optional base URL for the API
*/
constructor(apiKey: string, baseUrl?: string);
private makeRequest;
/**
* Fetch and analyze a LinkedIn profile.
* @param profileUrl - LinkedIn profile URL to analyze
*/
getProfile(profileUrl: string): Promise<ApiResponse>;
/**
* Analyze a company based on its LinkedIn URL.
* @param linkedinUrl - Company's LinkedIn URL
*/
analyzeCompany(linkedinUrl: string): Promise<ApiResponse>;
/**
* Scrape a website.
* @param url - URL to scrape
* @param formats - Output formats (default: ['html'])
*/
scrape(url: string, formats?: string[]): Promise<ApiResponse>;
/**
* Crawl a website.
* @param url - Starting URL to crawl
* @param formats - Output formats (default: ['html'])
* @param maxPages - Maximum number of pages to crawl (default: 10)
*/
crawl(url: string, formats?: string[], maxPages?: number): Promise<ApiResponse>;
/**
* Perform a Google search.
* @param query - Search query
* @param location - Search location (default: 'US')
* @param numResults - Number of results to return (default: 15)
* @returns Promise<ApiResponse> - Returns either an object or array response
*/
search(query: string, location?: string, numResults?: number): Promise<ApiResponse>;
/**
* Extract specific information from a website using AI.
* @param url - Website URL to analyze
* @param query - Query describing what information to extract
*/
extract(url: string, query: string): Promise<ApiResponse>;
/**
* Get current API key status and rate limit information.
*/
getStatus(): Promise<ApiResponse>;
}
export {};