@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.1
@auth ApiKey api_key in query
@endpoints 8
@toc ai(2), html(1), text(1), selected(1), selected-multiple(1), serp(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)=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)=json}
@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)=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 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)=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)=json}
@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)=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)=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)=json}
@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)=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}
@returns(200) {search_parameters: map{engine: str, q: str, gl: str, hl: str, page: int}, organic_results: [map], pagination: map{current: int, next: int}}
@errors {400, 402, 403, 429, 500, 504}

@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
