@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api WebScraping.AI
@base https://api.webscraping.ai
@version 3.2.2
@auth ApiKey api_key in query
@endpoints 10
@toc ai(2), html(1), text(1), selected(1), selected-multiple(1), serp(2), data(1), account(1)

@group ai
@endpoint GET /ai/question
@required {url: str}
@optional {question: str, headers: map, timeout: int=10000, js: bool=true, js_timeout: int=2000, wait_for: str, proxy: str(datacenter/residential/stealth/auto)=datacenter, country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us, custom_proxy: str, device: str(desktop/mobile/tablet)=desktop, error_on_404: bool=false, error_on_redirect: bool=false, js_script: str, format: str(json/text)=text}
@returns(200)
@errors {400, 402, 403, 429, 500, 504}

@endpoint GET /ai/fields
@required {url: str, fields: map}
@optional {headers: map, timeout: int=10000, js: bool=true, js_timeout: int=2000, wait_for: str, proxy: str(datacenter/residential/stealth/auto)=datacenter, country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us, custom_proxy: str, device: str(desktop/mobile/tablet)=desktop, error_on_404: bool=false, error_on_redirect: bool=false, js_script: str}
@returns(200) {result: map}
@errors {400, 402, 403, 429, 500, 504}

@endgroup

@group html
@endpoint GET /html
@required {url: str}
@optional {headers: map, timeout: int=10000, js: bool=true, js_timeout: int=2000, wait_for: str, proxy: str(datacenter/residential/stealth/auto)=datacenter, country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us, custom_proxy: str, device: str(desktop/mobile/tablet)=desktop, error_on_404: bool=false, error_on_redirect: bool=false, js_script: str, return_script_result: bool=false, format: str(json/text)=text}
@returns(200)
@errors {400, 402, 403, 429, 500, 504}

@endgroup

@group text
@endpoint GET /text
@required {url: str}
@optional {text_format: str(plain/xml/json)=plain, return_links: bool=false, headers: map, timeout: int=10000, js: bool=true, js_timeout: int=2000, wait_for: str, proxy: str(datacenter/residential/stealth/auto)=datacenter, country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us, custom_proxy: str, device: str(desktop/mobile/tablet)=desktop, error_on_404: bool=false, error_on_redirect: bool=false, js_script: str}
@returns(200)
@errors {400, 402, 403, 429, 500, 504}

@endgroup

@group selected
@endpoint GET /selected
@required {url: str}
@optional {selector: str, headers: map, timeout: int=10000, js: bool=true, js_timeout: int=2000, wait_for: str, proxy: str(datacenter/residential/stealth/auto)=datacenter, country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us, custom_proxy: str, device: str(desktop/mobile/tablet)=desktop, error_on_404: bool=false, error_on_redirect: bool=false, js_script: str, format: str(json/text)=text}
@returns(200)
@errors {400, 402, 403, 429, 500, 504}

@endgroup

@group selected-multiple
@endpoint GET /selected-multiple
@required {url: str}
@optional {selectors: [str], headers: map, timeout: int=10000, js: bool=true, js_timeout: int=2000, wait_for: str, proxy: str(datacenter/residential/stealth/auto)=datacenter, country: str(us/gb/de/it/fr/ca/es/ru/jp/kr/in/hk/tr)=us, custom_proxy: str, device: str(desktop/mobile/tablet)=desktop, error_on_404: bool=false, error_on_redirect: bool=false, js_script: str}
@returns(200)
@errors {400, 402, 403, 429, 500, 504}

@endgroup

@group serp
@endpoint GET /serp
@required {q: str}
@optional {engine: str=google, gl: str=us, hl: str=en, page: int=1, pages: int=1, location: str, uule: str, lat: num, lon: num, radius: int}
@returns(200) {search_parameters: map{engine: str, q: str, gl: str, hl: str, page: int, pages: int, location_requested: str, location_used: str, lat: num, lon: num, radius: int}, search_information: map{query_displayed: str, organic_results_state: str, showing_results_for: str}, organic_results: [map], related_searches: [map], pagination: map{current: int, pages_returned: int, next: int}}
@errors {400, 402, 403, 429, 500, 504}

@endpoint GET /serp/locations
@optional {q: str, limit: int=10}
@returns(200)
@errors {400}

@endgroup

@group data
@endpoint GET /data
@required {url: str}
@optional {country: str=us, transcript: bool=false, transcript_language: str, timeout: int=10000, js_timeout: int=2000, wait_for: str, device: str(desktop/mobile/tablet)=desktop}
@returns(200) {request_parameters: map{url: str, provider: str, type: str}, parse_status: str, data: map?}
@errors {400, 402, 403, 422, 429, 500, 503}

@endgroup

@group account
@endpoint GET /account
@returns(200) {email: str, remaining_api_calls: int, remaining_monthly_credits: int, remaining_payg_credits: int, remaining_total_credits: int, resets_at: int, remaining_concurrency: int}
@errors {403}

@endgroup

@end
