diff --git a/.gitignore b/.gitignore index 5f36ff5..c912a25 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,7 @@ target/ .ipynb_checkpoints test.py +key.pem +mcp-publisher.exe +mcp-publisher.tar.gz +openapi.json \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c51afec..8911554 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,7 +1,6 @@ .github/workflows/python.yml .gitignore .gitlab-ci.yml -.openapi-generator-ignore .travis.yml README.md docs/ApiToolApi.md @@ -20,6 +19,9 @@ docs/DnsSecMetaDto.md docs/DnsSecResponseDto.md docs/ExtractionSchemaDto.md docs/ExtractionSchemaDtoFieldsInner.md +docs/GroundedAnswerDataDto.md +docs/GroundedAnswerResponseDto.md +docs/GroundedSourceDto.md docs/HealthResponseDto.md docs/ImageSearchResponseDto.md docs/ImageSearchResultItemDto.md @@ -58,6 +60,7 @@ docs/RedirectCheckMetaDto.md docs/RedirectCheckResponseDto.md docs/RedirectHopDto.md docs/ScreenshotDto.md +docs/ScreenshotInlineDto.md docs/ScreenshotMetaDto.md docs/ScreenshotResponseDto.md docs/Search200Response.md @@ -88,6 +91,7 @@ docs/Url2PdfResponseDto.md docs/WebScrapeDto.md docs/WebScrapeMetaDto.md docs/WebScrapeResponseDto.md +docs/WebScrapeResponseDtoData.md geekflare_api/__init__.py geekflare_api/api/__init__.py geekflare_api/api/api_tool_api.py @@ -111,6 +115,9 @@ geekflare_api/models/dns_sec_meta_dto.py geekflare_api/models/dns_sec_response_dto.py geekflare_api/models/extraction_schema_dto.py geekflare_api/models/extraction_schema_dto_fields_inner.py +geekflare_api/models/grounded_answer_data_dto.py +geekflare_api/models/grounded_answer_response_dto.py +geekflare_api/models/grounded_source_dto.py geekflare_api/models/health_response_dto.py geekflare_api/models/image_search_response_dto.py geekflare_api/models/image_search_result_item_dto.py @@ -149,6 +156,7 @@ geekflare_api/models/redirect_check_meta_dto.py geekflare_api/models/redirect_check_response_dto.py geekflare_api/models/redirect_hop_dto.py geekflare_api/models/screenshot_dto.py +geekflare_api/models/screenshot_inline_dto.py geekflare_api/models/screenshot_meta_dto.py geekflare_api/models/screenshot_response_dto.py geekflare_api/models/search200_response.py @@ -179,6 +187,7 @@ geekflare_api/models/url2_pdf_response_dto.py geekflare_api/models/web_scrape_dto.py geekflare_api/models/web_scrape_meta_dto.py geekflare_api/models/web_scrape_response_dto.py +geekflare_api/models/web_scrape_response_dto_data.py geekflare_api/py.typed geekflare_api/rest.py git_push.sh @@ -188,88 +197,9 @@ setup.cfg setup.py test-requirements.txt test/__init__.py -test/test_api_tool_api.py -test/test_base_error_response_dto.py -test/test_broken_link_dto.py -test/test_broken_link_meta_dto.py -test/test_broken_link_response_dto.py -test/test_broken_link_summary_dto.py -test/test_default_extraction_field_dto.py -test/test_dns_meta_dto.py -test/test_dns_record_dto.py -test/test_dns_record_response_dto.py -test/test_dns_sec_data_dto.py -test/test_dns_sec_dto.py -test/test_dns_sec_meta_dto.py -test/test_dns_sec_response_dto.py -test/test_extraction_schema_dto.py -test/test_extraction_schema_dto_fields_inner.py -test/test_health_response_dto.py -test/test_image_search_response_dto.py -test/test_image_search_result_item_dto.py -test/test_lighthouse_dto.py -test/test_lighthouse_meta_dto.py -test/test_lighthouse_response_dto.py -test/test_load_time_data_dto.py -test/test_load_time_dto.py -test/test_load_time_meta_dto.py -test/test_load_time_response_dto.py -test/test_margin_dto.py -test/test_meta_scrape_dto.py -test/test_meta_scrape_meta_dto.py -test/test_meta_scrape_response_dto.py -test/test_meta_scrape_response_dto_data.py -test/test_mixed_content_data_dto.py -test/test_mixed_content_dto.py -test/test_mixed_content_meta_dto.py -test/test_mixed_content_response_dto.py -test/test_mixed_content_response_dto_data.py -test/test_mtr_data_dto.py -test/test_mtr_dto.py -test/test_mtr_meta_dto.py -test/test_mtr_response_dto.py -test/test_network_dto.py -test/test_open_port_dto.py -test/test_open_port_meta_dto.py -test/test_open_port_response_dto.py -test/test_ping_data_dto.py -test/test_ping_dto.py -test/test_ping_meta_dto.py -test/test_ping_response_dto.py -test/test_protocol_support_dto.py -test/test_redirect_check_dto.py -test/test_redirect_check_meta_dto.py -test/test_redirect_check_response_dto.py -test/test_redirect_hop_dto.py -test/test_screenshot_dto.py -test/test_screenshot_meta_dto.py -test/test_screenshot_response_dto.py -test/test_search200_response.py -test/test_search_html_response_dto.py -test/test_search_markdown_response_dto.py -test/test_search_meta_dto.py -test/test_search_request_dto.py -test/test_search_response_dto.py -test/test_search_result_item_dto.py -test/test_selector_extraction_field_dto.py -test/test_service_health_response_dto.py -test/test_service_status.py -test/test_site_status_dto.py -test/test_site_status_meta_dto.py -test/test_site_status_response_dto.py -test/test_test_meta_dto.py -test/test_timings_dto.py -test/test_tls_certificate_dto.py -test/test_tls_certificate_issuer_dto.py -test/test_tls_protocols_dto.py -test/test_tls_scan_data_dto.py -test/test_tls_scan_dto.py -test/test_tls_scan_meta_dto.py -test/test_tls_scan_response_dto.py -test/test_url2_pdf_dto.py -test/test_url2_pdf_meta_dto.py -test/test_url2_pdf_response_dto.py -test/test_web_scrape_dto.py -test/test_web_scrape_meta_dto.py -test/test_web_scrape_response_dto.py +test/test_grounded_answer_data_dto.py +test/test_grounded_answer_response_dto.py +test/test_grounded_source_dto.py +test/test_screenshot_inline_dto.py +test/test_web_scrape_response_dto_data.py tox.ini diff --git a/README.md b/README.md index 3470094..d4068c0 100644 --- a/README.md +++ b/README.md @@ -61,3 +61,5 @@ except ApiException as e: ## License MIT + +mcp-name: com.geekflare/mcp \ No newline at end of file diff --git a/docs/ApiToolApi.md b/docs/ApiToolApi.md index c26cc07..4232e08 100644 --- a/docs/ApiToolApi.md +++ b/docs/ApiToolApi.md @@ -98,8 +98,8 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successfully checked for broken links | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**422** | Unable to connect to the target website. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -178,8 +178,8 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successfully retrieved DNS records | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**500** | DNS lookup failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -258,8 +258,10 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | DNSSEC test result retrieved successfully | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**500** | DNSSEC check failed. | - | +**502** | DNSSEC query failed. | - | +**504** | DNS server timed out. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -338,8 +340,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successfully ran Lighthouse audit | - | -**400** | Bad request (e.g. invalid URL or parameters) | - | -**500** | Internal server error while running Lighthouse audit | - | +**400** | Invalid URL. | - | +**422** | Unable to connect to the target website. | - | +**500** | Lighthouse audit failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -418,8 +421,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Load time retrieved successfully | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**422** | Unable to connect to the target website. | - | +**500** | Failed to measure page load time. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -498,8 +502,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successfully scraped webpage meta | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**422** | No metadata found. | - | +**500** | Crawling failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -578,8 +583,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Site status retrieved successfully | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**422** | Unable to connect to the target website. | - | +**500** | Failed to check for mixed content. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -658,8 +664,8 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | MTR test completed successfully | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**500** | MTR is not installed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -738,8 +744,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Open ports retrieved successfully | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**408** | Port scan timed out. | - | +**500** | Port scan failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -818,8 +825,8 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Ping test completed successfully | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**504** | Host is unreachable. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -898,8 +905,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successfully retrieved redirect chain | - | -**400** | Bad request | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**429** | Too many redirects. | - | +**500** | Redirect check failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -978,8 +986,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successfully captured screenshot | - | -**400** | Bad request (e.g. invalid URL or parameters) | - | -**500** | Internal server error while capturing screenshot | - | +**400** | Invalid URL. | - | +**422** | Unable to connect to the target website. | - | +**500** | Screenshot generation failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -988,7 +997,7 @@ Name | Type | Description | Notes Search API for AI Agents & LLMs -Search the web for AI, remove noise like ads and unnecessary HTML, and return clean data in JSON, Markdown, or HTML formats, with support for image search and news. +Structured search results from the web or news. Strips out ads and HTML noise to provide pure data in JSON, Markdown, or HTML. Fully supports AI-grounded answers, search-with-scrape, image search, and targeted Web or News sourcing. ### Example @@ -1060,8 +1069,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Search results (format depends on request) | - | -**400** | Bad request | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**422** | Unable to connect to the target website. | - | +**500** | Search failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1140,8 +1150,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Site status retrieved successfully | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**429** | Too many redirects. | - | +**500** | Site status check failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1220,8 +1231,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successfully retrieved TLS scan information | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**422** | TLS handshake failed. | - | +**500** | TLS scan failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1300,8 +1312,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successfully captured Url2Pdf | - | -**400** | Bad request (e.g. invalid URL or parameters) | - | -**500** | Internal server error while capturing Url2Pdf | - | +**400** | Invalid URL. | - | +**422** | Unable to connect to the target website. | - | +**500** | PDF conversion failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) @@ -1380,8 +1393,9 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Successfully scraped webpage | - | -**400** | Bad request (invalid parameters) | - | -**500** | Internal server error | - | +**400** | Invalid URL. | - | +**422** | Unable to connect to the target website. | - | +**500** | Crawling failed. | - | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/BrokenLinkSummaryDto.md b/docs/BrokenLinkSummaryDto.md index 1750de3..9c4a9d9 100644 --- a/docs/BrokenLinkSummaryDto.md +++ b/docs/BrokenLinkSummaryDto.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **redirects** | **float** | Number of redirect links (3xx status codes) | **broken** | **float** | Number of broken links (4xx status codes and DNS/network failures) | **server_error** | **float** | Number of server errors (5xx status codes) | +**forbidden** | **float** | Number of forbidden links (403 status codes) | +**timed_out** | **float** | Number of timed-out links | ## Example diff --git a/docs/GroundedAnswerDataDto.md b/docs/GroundedAnswerDataDto.md new file mode 100644 index 0000000..0cb5883 --- /dev/null +++ b/docs/GroundedAnswerDataDto.md @@ -0,0 +1,30 @@ +# GroundedAnswerDataDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**answer** | **str** | AI-synthesized answer with inline citations | +**sources** | [**List[GroundedSourceDto]**](GroundedSourceDto.md) | Sources cited in the answer | + +## Example + +```python +from geekflare_api.models.grounded_answer_data_dto import GroundedAnswerDataDto + +# TODO update the JSON string below +json = "{}" +# create an instance of GroundedAnswerDataDto from a JSON string +grounded_answer_data_dto_instance = GroundedAnswerDataDto.from_json(json) +# print the JSON string representation of the object +print(GroundedAnswerDataDto.to_json()) + +# convert the object into a dict +grounded_answer_data_dto_dict = grounded_answer_data_dto_instance.to_dict() +# create an instance of GroundedAnswerDataDto from a dict +grounded_answer_data_dto_from_dict = GroundedAnswerDataDto.from_dict(grounded_answer_data_dto_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GroundedAnswerResponseDto.md b/docs/GroundedAnswerResponseDto.md new file mode 100644 index 0000000..f3f8d3f --- /dev/null +++ b/docs/GroundedAnswerResponseDto.md @@ -0,0 +1,33 @@ +# GroundedAnswerResponseDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**timestamp** | **float** | Timestamp of the request in milliseconds | +**api_status** | **str** | API status message | +**api_code** | **float** | API status code | +**meta** | [**SearchMetaDto**](SearchMetaDto.md) | | +**data** | [**GroundedAnswerDataDto**](GroundedAnswerDataDto.md) | | + +## Example + +```python +from geekflare_api.models.grounded_answer_response_dto import GroundedAnswerResponseDto + +# TODO update the JSON string below +json = "{}" +# create an instance of GroundedAnswerResponseDto from a JSON string +grounded_answer_response_dto_instance = GroundedAnswerResponseDto.from_json(json) +# print the JSON string representation of the object +print(GroundedAnswerResponseDto.to_json()) + +# convert the object into a dict +grounded_answer_response_dto_dict = grounded_answer_response_dto_instance.to_dict() +# create an instance of GroundedAnswerResponseDto from a dict +grounded_answer_response_dto_from_dict = GroundedAnswerResponseDto.from_dict(grounded_answer_response_dto_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GroundedSourceDto.md b/docs/GroundedSourceDto.md new file mode 100644 index 0000000..a5ad22d --- /dev/null +++ b/docs/GroundedSourceDto.md @@ -0,0 +1,31 @@ +# GroundedSourceDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | | +**url** | **str** | | +**position** | **float** | | + +## Example + +```python +from geekflare_api.models.grounded_source_dto import GroundedSourceDto + +# TODO update the JSON string below +json = "{}" +# create an instance of GroundedSourceDto from a JSON string +grounded_source_dto_instance = GroundedSourceDto.from_json(json) +# print the JSON string representation of the object +print(GroundedSourceDto.to_json()) + +# convert the object into a dict +grounded_source_dto_dict = grounded_source_dto_instance.to_dict() +# create an instance of GroundedSourceDto from a dict +grounded_source_dto_from_dict = GroundedSourceDto.from_dict(grounded_source_dto_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScreenshotDto.md b/docs/ScreenshotDto.md index 7ea9d3b..a667f7e 100644 --- a/docs/ScreenshotDto.md +++ b/docs/ScreenshotDto.md @@ -25,6 +25,9 @@ Name | Type | Description | Notes **quality** | **float** | Image quality (for JPEG/WEBP) | [optional] **scale_factor** | **float** | Device scale factor | [optional] **capture_beyond_viewport** | **bool** | Capture beyond viewport if possible | [optional] +**selector** | **str** | CSS selector to capture only a specific element on the page. Supports class (.), ID (#), and attribute selectors. | [optional] +**fallback_to_full_page** | **bool** | If true and the selector is not found, falls back to a full-page screenshot instead of returning an error. Default: false. | [optional] [default to False] +**inline** | **bool** | If true, includes a Base64-encoded image and data URI in the response. Useful for AI agents and LLMs that cannot fetch URLs. Default: false. | [optional] [default to False] ## Example diff --git a/docs/ScreenshotInlineDto.md b/docs/ScreenshotInlineDto.md new file mode 100644 index 0000000..3f3d84e --- /dev/null +++ b/docs/ScreenshotInlineDto.md @@ -0,0 +1,30 @@ +# ScreenshotInlineDto + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_base64** | **str** | Raw Base64-encoded image string | +**data_uri** | **str** | Data URI — ready to embed in an <img> tag or pass directly to an LLM | + +## Example + +```python +from geekflare_api.models.screenshot_inline_dto import ScreenshotInlineDto + +# TODO update the JSON string below +json = "{}" +# create an instance of ScreenshotInlineDto from a JSON string +screenshot_inline_dto_instance = ScreenshotInlineDto.from_json(json) +# print the JSON string representation of the object +print(ScreenshotInlineDto.to_json()) + +# convert the object into a dict +screenshot_inline_dto_dict = screenshot_inline_dto_instance.to_dict() +# create an instance of ScreenshotInlineDto from a dict +screenshot_inline_dto_from_dict = ScreenshotInlineDto.from_dict(screenshot_inline_dto_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ScreenshotMetaDto.md b/docs/ScreenshotMetaDto.md index 112919a..c09c0cc 100644 --- a/docs/ScreenshotMetaDto.md +++ b/docs/ScreenshotMetaDto.md @@ -25,6 +25,9 @@ Name | Type | Description | Notes **quality** | **float** | Image quality (JPEG/WEBP) | [optional] **scale_factor** | **float** | Device scale factor | [optional] **capture_beyond_viewport** | **bool** | Capture beyond viewport | [optional] +**selector** | **str** | CSS selector that was targeted, if provided | [optional] +**fallback_to_full_page** | **bool** | Whether fallback to full-page was enabled | [optional] +**inline** | **bool** | Whether inline base64 output was requested | [optional] **test** | [**TestMetaDto**](TestMetaDto.md) | Test details | ## Example diff --git a/docs/ScreenshotResponseDto.md b/docs/ScreenshotResponseDto.md index a4f4b2a..b6da101 100644 --- a/docs/ScreenshotResponseDto.md +++ b/docs/ScreenshotResponseDto.md @@ -9,7 +9,8 @@ Name | Type | Description | Notes **api_status** | **str** | API status message | **api_code** | **float** | API status code | **meta** | [**ScreenshotMetaDto**](ScreenshotMetaDto.md) | Metadata about the request | -**data** | **str** | Screenshot URL or base64 string | +**data** | **str** | URL of the captured screenshot | +**inline** | [**ScreenshotInlineDto**](ScreenshotInlineDto.md) | Inline Base64 image data. Present only when the request included `inline: true`. | [optional] ## Example diff --git a/docs/Search200Response.md b/docs/Search200Response.md index 672b778..d6cf1dd 100644 --- a/docs/Search200Response.md +++ b/docs/Search200Response.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **api_status** | **str** | API status message | **api_code** | **float** | API status code | **meta** | [**SearchMetaDto**](SearchMetaDto.md) | | -**data** | **object** | | +**data** | [**GroundedAnswerDataDto**](GroundedAnswerDataDto.md) | | ## Example diff --git a/docs/SearchRequestDto.md b/docs/SearchRequestDto.md index a70406d..1555241 100644 --- a/docs/SearchRequestDto.md +++ b/docs/SearchRequestDto.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **format** | **str** | Output format | [optional] [default to 'json'] **scrape** | **bool** | scrape and extract content from SERP result URLs | [optional] [default to False] **scrape_limit** | **float** | Number of URLs to scrape (requires scrape: true) | [optional] [default to 3] +**grounded_answer** | **bool** | Use AI to synthesize a grounded answer from search results. | [optional] [default to False] ## Example diff --git a/docs/SearchResultItemDto.md b/docs/SearchResultItemDto.md index 211dbc9..d341a03 100644 --- a/docs/SearchResultItemDto.md +++ b/docs/SearchResultItemDto.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **var_date** | **str** | Published date (if available) | [optional] **position** | **float** | Rank position | **content** | **object** | Scraped cleaned HTML content from the result URL | [optional] +**thumbnail** | **object** | Thumbnail image URL (if available) | [optional] ## Example diff --git a/docs/WebScrapeResponseDto.md b/docs/WebScrapeResponseDto.md index 25bb4b8..be0420f 100644 --- a/docs/WebScrapeResponseDto.md +++ b/docs/WebScrapeResponseDto.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **api_status** | **str** | API status message | **api_code** | **float** | API status code | **meta** | [**WebScrapeMetaDto**](WebScrapeMetaDto.md) | Metadata about the request | -**data** | [**MetaScrapeResponseDtoData**](MetaScrapeResponseDtoData.md) | | +**data** | [**WebScrapeResponseDtoData**](WebScrapeResponseDtoData.md) | | ## Example diff --git a/docs/WebScrapeResponseDtoData.md b/docs/WebScrapeResponseDtoData.md new file mode 100644 index 0000000..6a7c80f --- /dev/null +++ b/docs/WebScrapeResponseDtoData.md @@ -0,0 +1,29 @@ +# WebScrapeResponseDtoData + +Scraped data (URL or inline content depending on output) + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from geekflare_api.models.web_scrape_response_dto_data import WebScrapeResponseDtoData + +# TODO update the JSON string below +json = "{}" +# create an instance of WebScrapeResponseDtoData from a JSON string +web_scrape_response_dto_data_instance = WebScrapeResponseDtoData.from_json(json) +# print the JSON string representation of the object +print(WebScrapeResponseDtoData.to_json()) + +# convert the object into a dict +web_scrape_response_dto_data_dict = web_scrape_response_dto_data_instance.to_dict() +# create an instance of WebScrapeResponseDtoData from a dict +web_scrape_response_dto_data_from_dict = WebScrapeResponseDtoData.from_dict(web_scrape_response_dto_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/geekflare_api/__init__.py b/geekflare_api/__init__.py index c9bb073..e8af4aa 100644 --- a/geekflare_api/__init__.py +++ b/geekflare_api/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "0.1.0" +__version__ = "0.1.2" # Define package exports __all__ = [ @@ -43,6 +43,9 @@ "DnsSecResponseDto", "ExtractionSchemaDto", "ExtractionSchemaDtoFieldsInner", + "GroundedAnswerDataDto", + "GroundedAnswerResponseDto", + "GroundedSourceDto", "HealthResponseDto", "ImageSearchResponseDto", "ImageSearchResultItemDto", @@ -81,6 +84,7 @@ "RedirectCheckResponseDto", "RedirectHopDto", "ScreenshotDto", + "ScreenshotInlineDto", "ScreenshotMetaDto", "ScreenshotResponseDto", "Search200Response", @@ -111,6 +115,7 @@ "WebScrapeDto", "WebScrapeMetaDto", "WebScrapeResponseDto", + "WebScrapeResponseDtoData", ] # import apis into sdk package @@ -143,6 +148,9 @@ from geekflare_api.models.dns_sec_response_dto import DnsSecResponseDto as DnsSecResponseDto from geekflare_api.models.extraction_schema_dto import ExtractionSchemaDto as ExtractionSchemaDto from geekflare_api.models.extraction_schema_dto_fields_inner import ExtractionSchemaDtoFieldsInner as ExtractionSchemaDtoFieldsInner +from geekflare_api.models.grounded_answer_data_dto import GroundedAnswerDataDto as GroundedAnswerDataDto +from geekflare_api.models.grounded_answer_response_dto import GroundedAnswerResponseDto as GroundedAnswerResponseDto +from geekflare_api.models.grounded_source_dto import GroundedSourceDto as GroundedSourceDto from geekflare_api.models.health_response_dto import HealthResponseDto as HealthResponseDto from geekflare_api.models.image_search_response_dto import ImageSearchResponseDto as ImageSearchResponseDto from geekflare_api.models.image_search_result_item_dto import ImageSearchResultItemDto as ImageSearchResultItemDto @@ -181,6 +189,7 @@ from geekflare_api.models.redirect_check_response_dto import RedirectCheckResponseDto as RedirectCheckResponseDto from geekflare_api.models.redirect_hop_dto import RedirectHopDto as RedirectHopDto from geekflare_api.models.screenshot_dto import ScreenshotDto as ScreenshotDto +from geekflare_api.models.screenshot_inline_dto import ScreenshotInlineDto as ScreenshotInlineDto from geekflare_api.models.screenshot_meta_dto import ScreenshotMetaDto as ScreenshotMetaDto from geekflare_api.models.screenshot_response_dto import ScreenshotResponseDto as ScreenshotResponseDto from geekflare_api.models.search200_response import Search200Response as Search200Response @@ -211,5 +220,5 @@ from geekflare_api.models.web_scrape_dto import WebScrapeDto as WebScrapeDto from geekflare_api.models.web_scrape_meta_dto import WebScrapeMetaDto as WebScrapeMetaDto from geekflare_api.models.web_scrape_response_dto import WebScrapeResponseDto as WebScrapeResponseDto -from geekflare_api.client import GeekflareClient +from geekflare_api.models.web_scrape_response_dto_data import WebScrapeResponseDtoData as WebScrapeResponseDtoData diff --git a/geekflare_api/api/api_tool_api.py b/geekflare_api/api/api_tool_api.py index 917c25b..3d54b89 100644 --- a/geekflare_api/api/api_tool_api.py +++ b/geekflare_api/api/api_tool_api.py @@ -123,7 +123,7 @@ def broken_link( _response_types_map: Dict[str, Optional[str]] = { '200': "BrokenLinkResponseDto", '400': "BaseErrorResponseDto", - '500': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", } response_data = self.api_client.call_api( *_param, @@ -191,7 +191,7 @@ def broken_link_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "BrokenLinkResponseDto", '400': "BaseErrorResponseDto", - '500': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", } response_data = self.api_client.call_api( *_param, @@ -259,7 +259,7 @@ def broken_link_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "BrokenLinkResponseDto", '400': "BaseErrorResponseDto", - '500': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", } response_data = self.api_client.call_api( *_param, @@ -678,6 +678,8 @@ def dns_sec( '200': "DnsSecResponseDto", '400': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", + '502': "BaseErrorResponseDto", + '504': "BaseErrorResponseDto", } response_data = self.api_client.call_api( *_param, @@ -746,6 +748,8 @@ def dns_sec_with_http_info( '200': "DnsSecResponseDto", '400': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", + '502': "BaseErrorResponseDto", + '504': "BaseErrorResponseDto", } response_data = self.api_client.call_api( *_param, @@ -814,6 +818,8 @@ def dns_sec_without_preload_content( '200': "DnsSecResponseDto", '400': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", + '502': "BaseErrorResponseDto", + '504': "BaseErrorResponseDto", } response_data = self.api_client.call_api( *_param, @@ -954,6 +960,7 @@ def lighthouse( _response_types_map: Dict[str, Optional[str]] = { '200': "LighthouseResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1022,6 +1029,7 @@ def lighthouse_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "LighthouseResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1090,6 +1098,7 @@ def lighthouse_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "LighthouseResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1231,6 +1240,7 @@ def load_time( _response_types_map: Dict[str, Optional[str]] = { '200': "LoadTimeResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1299,6 +1309,7 @@ def load_time_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "LoadTimeResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1367,6 +1378,7 @@ def load_time_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "LoadTimeResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1508,6 +1520,7 @@ def meta_scrape( _response_types_map: Dict[str, Optional[str]] = { '200': "MetaScrapeResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1576,6 +1589,7 @@ def meta_scrape_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "MetaScrapeResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1644,6 +1658,7 @@ def meta_scrape_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "MetaScrapeResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1785,6 +1800,7 @@ def mixed_content( _response_types_map: Dict[str, Optional[str]] = { '200': "MixedContentResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1853,6 +1869,7 @@ def mixed_content_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "MixedContentResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -1921,6 +1938,7 @@ def mixed_content_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "MixedContentResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -2339,6 +2357,7 @@ def open_ports( _response_types_map: Dict[str, Optional[str]] = { '200': "OpenPortResponseDto", '400': "BaseErrorResponseDto", + '408': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -2407,6 +2426,7 @@ def open_ports_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "OpenPortResponseDto", '400': "BaseErrorResponseDto", + '408': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -2475,6 +2495,7 @@ def open_ports_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "OpenPortResponseDto", '400': "BaseErrorResponseDto", + '408': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -2616,7 +2637,7 @@ def ping( _response_types_map: Dict[str, Optional[str]] = { '200': "PingResponseDto", '400': "BaseErrorResponseDto", - '500': "BaseErrorResponseDto", + '504': "BaseErrorResponseDto", } response_data = self.api_client.call_api( *_param, @@ -2684,7 +2705,7 @@ def ping_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "PingResponseDto", '400': "BaseErrorResponseDto", - '500': "BaseErrorResponseDto", + '504': "BaseErrorResponseDto", } response_data = self.api_client.call_api( *_param, @@ -2752,7 +2773,7 @@ def ping_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "PingResponseDto", '400': "BaseErrorResponseDto", - '500': "BaseErrorResponseDto", + '504': "BaseErrorResponseDto", } response_data = self.api_client.call_api( *_param, @@ -2893,6 +2914,7 @@ def redirect_check( _response_types_map: Dict[str, Optional[str]] = { '200': "RedirectCheckResponseDto", '400': "BaseErrorResponseDto", + '429': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -2961,6 +2983,7 @@ def redirect_check_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "RedirectCheckResponseDto", '400': "BaseErrorResponseDto", + '429': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -3029,6 +3052,7 @@ def redirect_check_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "RedirectCheckResponseDto", '400': "BaseErrorResponseDto", + '429': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -3170,6 +3194,7 @@ def screenshot( _response_types_map: Dict[str, Optional[str]] = { '200': "ScreenshotResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -3238,6 +3263,7 @@ def screenshot_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ScreenshotResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -3306,6 +3332,7 @@ def screenshot_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ScreenshotResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -3411,7 +3438,7 @@ def search( ) -> Search200Response: """Search API for AI Agents & LLMs - Search the web for AI, remove noise like ads and unnecessary HTML, and return clean data in JSON, Markdown, or HTML formats, with support for image search and news. + Structured search results from the web or news. Strips out ads and HTML noise to provide pure data in JSON, Markdown, or HTML. Fully supports AI-grounded answers, search-with-scrape, image search, and targeted Web or News sourcing. :param search_request_dto: (required) :type search_request_dto: SearchRequestDto @@ -3448,6 +3475,7 @@ def search( _response_types_map: Dict[str, Optional[str]] = { '200': "Search200Response", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -3480,7 +3508,7 @@ def search_with_http_info( ) -> ApiResponse[Search200Response]: """Search API for AI Agents & LLMs - Search the web for AI, remove noise like ads and unnecessary HTML, and return clean data in JSON, Markdown, or HTML formats, with support for image search and news. + Structured search results from the web or news. Strips out ads and HTML noise to provide pure data in JSON, Markdown, or HTML. Fully supports AI-grounded answers, search-with-scrape, image search, and targeted Web or News sourcing. :param search_request_dto: (required) :type search_request_dto: SearchRequestDto @@ -3517,6 +3545,7 @@ def search_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Search200Response", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -3549,7 +3578,7 @@ def search_without_preload_content( ) -> RESTResponseType: """Search API for AI Agents & LLMs - Search the web for AI, remove noise like ads and unnecessary HTML, and return clean data in JSON, Markdown, or HTML formats, with support for image search and news. + Structured search results from the web or news. Strips out ads and HTML noise to provide pure data in JSON, Markdown, or HTML. Fully supports AI-grounded answers, search-with-scrape, image search, and targeted Web or News sourcing. :param search_request_dto: (required) :type search_request_dto: SearchRequestDto @@ -3586,6 +3615,7 @@ def search_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Search200Response", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -3727,6 +3757,7 @@ def site_status( _response_types_map: Dict[str, Optional[str]] = { '200': "SiteStatusResponseDto", '400': "BaseErrorResponseDto", + '429': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -3795,6 +3826,7 @@ def site_status_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "SiteStatusResponseDto", '400': "BaseErrorResponseDto", + '429': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -3863,6 +3895,7 @@ def site_status_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "SiteStatusResponseDto", '400': "BaseErrorResponseDto", + '429': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -4004,6 +4037,7 @@ def tls_scan( _response_types_map: Dict[str, Optional[str]] = { '200': "TlsScanResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -4072,6 +4106,7 @@ def tls_scan_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "TlsScanResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -4140,6 +4175,7 @@ def tls_scan_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "TlsScanResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -4281,6 +4317,7 @@ def url2_pdf( _response_types_map: Dict[str, Optional[str]] = { '200': "Url2PdfResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -4349,6 +4386,7 @@ def url2_pdf_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Url2PdfResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -4417,6 +4455,7 @@ def url2_pdf_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Url2PdfResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -4558,6 +4597,7 @@ def web_scrape( _response_types_map: Dict[str, Optional[str]] = { '200': "WebScrapeResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -4626,6 +4666,7 @@ def web_scrape_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "WebScrapeResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( @@ -4694,6 +4735,7 @@ def web_scrape_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "WebScrapeResponseDto", '400': "BaseErrorResponseDto", + '422': "BaseErrorResponseDto", '500': "BaseErrorResponseDto", } response_data = self.api_client.call_api( diff --git a/geekflare_api/api_client.py b/geekflare_api/api_client.py index ecd1df4..c664ee9 100644 --- a/geekflare_api/api_client.py +++ b/geekflare_api/api_client.py @@ -91,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/0.1.0/python' + self.user_agent = 'OpenAPI-Generator/0.1.2/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/geekflare_api/configuration.py b/geekflare_api/configuration.py index 21f20f7..8dcf098 100644 --- a/geekflare_api/configuration.py +++ b/geekflare_api/configuration.py @@ -112,6 +112,9 @@ "AuthSettings", { "x-api-key": APIKeyAuthSetting, + "bearer-token": BearerFormatAuthSetting, + "gf_auth_session": APIKeyAuthSetting, + "x-internal-key": APIKeyAuthSetting, }, total=False, ) @@ -543,6 +546,32 @@ def auth_settings(self)-> AuthSettings: 'x-api-key', ), } + if self.access_token is not None: + auth['bearer-token'] = { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + if 'gf_auth_session' in self.api_key: + auth['gf_auth_session'] = { + 'type': 'api_key', + 'in': 'cookie', + 'key': 'gf_auth_session', + 'value': self.get_api_key_with_prefix( + 'gf_auth_session', + ), + } + if 'x-internal-key' in self.api_key: + auth['x-internal-key'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'x-internal-key', + 'value': self.get_api_key_with_prefix( + 'x-internal-key', + ), + } return auth def to_debug_report(self) -> str: @@ -554,7 +583,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0.0\n"\ - "SDK Package Version: 0.1.0".\ + "SDK Package Version: 0.1.2".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/geekflare_api/models/__init__.py b/geekflare_api/models/__init__.py index c442012..bcbd443 100644 --- a/geekflare_api/models/__init__.py +++ b/geekflare_api/models/__init__.py @@ -28,6 +28,9 @@ from geekflare_api.models.dns_sec_response_dto import DnsSecResponseDto from geekflare_api.models.extraction_schema_dto import ExtractionSchemaDto from geekflare_api.models.extraction_schema_dto_fields_inner import ExtractionSchemaDtoFieldsInner +from geekflare_api.models.grounded_answer_data_dto import GroundedAnswerDataDto +from geekflare_api.models.grounded_answer_response_dto import GroundedAnswerResponseDto +from geekflare_api.models.grounded_source_dto import GroundedSourceDto from geekflare_api.models.health_response_dto import HealthResponseDto from geekflare_api.models.image_search_response_dto import ImageSearchResponseDto from geekflare_api.models.image_search_result_item_dto import ImageSearchResultItemDto @@ -66,6 +69,7 @@ from geekflare_api.models.redirect_check_response_dto import RedirectCheckResponseDto from geekflare_api.models.redirect_hop_dto import RedirectHopDto from geekflare_api.models.screenshot_dto import ScreenshotDto +from geekflare_api.models.screenshot_inline_dto import ScreenshotInlineDto from geekflare_api.models.screenshot_meta_dto import ScreenshotMetaDto from geekflare_api.models.screenshot_response_dto import ScreenshotResponseDto from geekflare_api.models.search200_response import Search200Response @@ -96,4 +100,5 @@ from geekflare_api.models.web_scrape_dto import WebScrapeDto from geekflare_api.models.web_scrape_meta_dto import WebScrapeMetaDto from geekflare_api.models.web_scrape_response_dto import WebScrapeResponseDto +from geekflare_api.models.web_scrape_response_dto_data import WebScrapeResponseDtoData diff --git a/geekflare_api/models/base_error_response_dto.py b/geekflare_api/models/base_error_response_dto.py index 874ca90..ade8466 100644 --- a/geekflare_api/models/base_error_response_dto.py +++ b/geekflare_api/models/base_error_response_dto.py @@ -27,7 +27,7 @@ class BaseErrorResponseDto(BaseModel): """ BaseErrorResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1778737930991]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) message: StrictStr = Field(description="Error message", json_schema_extra={"examples": ["Invalid URL provided"]}) diff --git a/geekflare_api/models/broken_link_response_dto.py b/geekflare_api/models/broken_link_response_dto.py index cde6539..39fedc0 100644 --- a/geekflare_api/models/broken_link_response_dto.py +++ b/geekflare_api/models/broken_link_response_dto.py @@ -29,7 +29,7 @@ class BrokenLinkResponseDto(BaseModel): """ BrokenLinkResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) message: StrictStr = Field(description="Human-readable message about the broken link scan result", json_schema_extra={"examples": ["No broken links found."]}) diff --git a/geekflare_api/models/broken_link_summary_dto.py b/geekflare_api/models/broken_link_summary_dto.py index 6af48ef..a92f432 100644 --- a/geekflare_api/models/broken_link_summary_dto.py +++ b/geekflare_api/models/broken_link_summary_dto.py @@ -32,7 +32,9 @@ class BrokenLinkSummaryDto(BaseModel): redirects: Union[StrictFloat, StrictInt] = Field(description="Number of redirect links (3xx status codes)", json_schema_extra={"examples": [2]}) broken: Union[StrictFloat, StrictInt] = Field(description="Number of broken links (4xx status codes and DNS/network failures)", json_schema_extra={"examples": [1]}) server_error: Union[StrictFloat, StrictInt] = Field(description="Number of server errors (5xx status codes)", alias="serverError", json_schema_extra={"examples": [0]}) - __properties: ClassVar[List[str]] = ["total", "successful", "redirects", "broken", "serverError"] + forbidden: Union[StrictFloat, StrictInt] = Field(description="Number of forbidden links (403 status codes)", json_schema_extra={"examples": [0]}) + timed_out: Union[StrictFloat, StrictInt] = Field(description="Number of timed-out links", alias="timedOut", json_schema_extra={"examples": [0]}) + __properties: ClassVar[List[str]] = ["total", "successful", "redirects", "broken", "serverError", "forbidden", "timedOut"] model_config = ConfigDict( validate_by_name=True, @@ -89,7 +91,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "successful": obj.get("successful"), "redirects": obj.get("redirects"), "broken": obj.get("broken"), - "serverError": obj.get("serverError") + "serverError": obj.get("serverError"), + "forbidden": obj.get("forbidden"), + "timedOut": obj.get("timedOut") }) return _obj diff --git a/geekflare_api/models/dns_record_response_dto.py b/geekflare_api/models/dns_record_response_dto.py index 2db444e..09b1fce 100644 --- a/geekflare_api/models/dns_record_response_dto.py +++ b/geekflare_api/models/dns_record_response_dto.py @@ -28,7 +28,7 @@ class DnsRecordResponseDto(BaseModel): """ DnsRecordResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: DnsMetaDto = Field(description="Metadata about the request.") diff --git a/geekflare_api/models/dns_sec_response_dto.py b/geekflare_api/models/dns_sec_response_dto.py index 916b8c1..293ceb5 100644 --- a/geekflare_api/models/dns_sec_response_dto.py +++ b/geekflare_api/models/dns_sec_response_dto.py @@ -29,7 +29,7 @@ class DnsSecResponseDto(BaseModel): """ DnsSecResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: DnsSecMetaDto = Field(description="Metadata about the DNSSEC test") diff --git a/geekflare_api/models/grounded_answer_data_dto.py b/geekflare_api/models/grounded_answer_data_dto.py new file mode 100644 index 0000000..ef2664f --- /dev/null +++ b/geekflare_api/models/grounded_answer_data_dto.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from geekflare_api.models.grounded_source_dto import GroundedSourceDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GroundedAnswerDataDto(BaseModel): + """ + GroundedAnswerDataDto + """ # noqa: E501 + answer: StrictStr = Field(description="AI-synthesized answer with inline citations") + sources: List[GroundedSourceDto] = Field(description="Sources cited in the answer") + __properties: ClassVar[List[str]] = ["answer", "sources"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroundedAnswerDataDto from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in sources (list) + _items = [] + if self.sources: + for _item_sources in self.sources: + if _item_sources: + _items.append(_item_sources.to_dict()) + _dict['sources'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroundedAnswerDataDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "answer": obj.get("answer"), + "sources": [GroundedSourceDto.from_dict(_item) for _item in obj["sources"]] if obj.get("sources") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/grounded_answer_response_dto.py b/geekflare_api/models/grounded_answer_response_dto.py new file mode 100644 index 0000000..4d77e8d --- /dev/null +++ b/geekflare_api/models/grounded_answer_response_dto.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from geekflare_api.models.grounded_answer_data_dto import GroundedAnswerDataDto +from geekflare_api.models.search_meta_dto import SearchMetaDto +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GroundedAnswerResponseDto(BaseModel): + """ + GroundedAnswerResponseDto + """ # noqa: E501 + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) + api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) + api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) + meta: SearchMetaDto + data: GroundedAnswerDataDto + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + + @field_validator('api_status') + def api_status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'failure']): + raise ValueError("must be one of enum values ('success', 'failure')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroundedAnswerResponseDto from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroundedAnswerResponseDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timestamp": obj.get("timestamp"), + "apiStatus": obj.get("apiStatus"), + "apiCode": obj.get("apiCode"), + "meta": SearchMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": GroundedAnswerDataDto.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/geekflare_api/models/grounded_source_dto.py b/geekflare_api/models/grounded_source_dto.py new file mode 100644 index 0000000..3c50402 --- /dev/null +++ b/geekflare_api/models/grounded_source_dto.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GroundedSourceDto(BaseModel): + """ + GroundedSourceDto + """ # noqa: E501 + title: StrictStr = Field(json_schema_extra={"examples": ["web"]}) + url: StrictStr = Field(json_schema_extra={"examples": ["https://example.com"]}) + position: Union[StrictFloat, StrictInt] = Field(json_schema_extra={"examples": [1]}) + __properties: ClassVar[List[str]] = ["title", "url", "position"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroundedSourceDto from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroundedSourceDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "url": obj.get("url"), + "position": obj.get("position") + }) + return _obj + + diff --git a/geekflare_api/models/health_response_dto.py b/geekflare_api/models/health_response_dto.py index bb22e17..a1b464a 100644 --- a/geekflare_api/models/health_response_dto.py +++ b/geekflare_api/models/health_response_dto.py @@ -27,7 +27,7 @@ class HealthResponseDto(BaseModel): """ HealthResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) message: StrictStr = Field(description="Metadata about the request") diff --git a/geekflare_api/models/image_search_response_dto.py b/geekflare_api/models/image_search_response_dto.py index 7e71596..7c5c4d4 100644 --- a/geekflare_api/models/image_search_response_dto.py +++ b/geekflare_api/models/image_search_response_dto.py @@ -29,7 +29,7 @@ class ImageSearchResponseDto(BaseModel): """ ImageSearchResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: SearchMetaDto diff --git a/geekflare_api/models/lighthouse_response_dto.py b/geekflare_api/models/lighthouse_response_dto.py index 12f3e05..0d0bb7c 100644 --- a/geekflare_api/models/lighthouse_response_dto.py +++ b/geekflare_api/models/lighthouse_response_dto.py @@ -28,7 +28,7 @@ class LighthouseResponseDto(BaseModel): """ LighthouseResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: LighthouseMetaDto = Field(description="Metadata about the request") diff --git a/geekflare_api/models/load_time_response_dto.py b/geekflare_api/models/load_time_response_dto.py index c16731f..45fd128 100644 --- a/geekflare_api/models/load_time_response_dto.py +++ b/geekflare_api/models/load_time_response_dto.py @@ -29,7 +29,7 @@ class LoadTimeResponseDto(BaseModel): """ LoadTimeResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) message: Optional[StrictStr] = Field(default=None, description="Overall message about site reachability", json_schema_extra={"examples": ["Site is reachable."]}) diff --git a/geekflare_api/models/meta_scrape_response_dto.py b/geekflare_api/models/meta_scrape_response_dto.py index 72b64c2..e5898f7 100644 --- a/geekflare_api/models/meta_scrape_response_dto.py +++ b/geekflare_api/models/meta_scrape_response_dto.py @@ -29,7 +29,7 @@ class MetaScrapeResponseDto(BaseModel): """ MetaScrapeResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: MetaScrapeMetaDto = Field(description="Metadata about the request") diff --git a/geekflare_api/models/mixed_content_response_dto.py b/geekflare_api/models/mixed_content_response_dto.py index 80bfd9c..3d56bde 100644 --- a/geekflare_api/models/mixed_content_response_dto.py +++ b/geekflare_api/models/mixed_content_response_dto.py @@ -29,7 +29,7 @@ class MixedContentResponseDto(BaseModel): """ MixedContentResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) message: StrictStr = Field(description="Indicates whether mixed content found or not. It can either be \"Mixed content(s) found.\" or \"No mixed content found.\"", json_schema_extra={"examples": ["Mixed content(s) found."]}) diff --git a/geekflare_api/models/mixed_content_response_dto_data.py b/geekflare_api/models/mixed_content_response_dto_data.py index 6206fda..9be30db 100644 --- a/geekflare_api/models/mixed_content_response_dto_data.py +++ b/geekflare_api/models/mixed_content_response_dto_data.py @@ -31,7 +31,7 @@ class MixedContentResponseDtoData(BaseModel): # data type: List[str] oneof_schema_1_validator: Optional[List[StrictStr]] = Field(default=None, description="Simple array of all resources when no mixed content found", json_schema_extra={"examples": [["https://example.com/", "https://example.com/style.css", "https://example.com/script.js"]]}) # data type: MixedContentDataDto - oneof_schema_2_validator: Optional[MixedContentDataDto] = Field(default=None, description="Object with insecure and secure arrays when mixed content found") + oneof_schema_2_validator: Optional[MixedContentDataDto] = None actual_instance: Optional[Union[List[str], MixedContentDataDto]] = None one_of_schemas: Set[str] = { "List[str]", "MixedContentDataDto" } diff --git a/geekflare_api/models/mtr_response_dto.py b/geekflare_api/models/mtr_response_dto.py index 5c07835..c000307 100644 --- a/geekflare_api/models/mtr_response_dto.py +++ b/geekflare_api/models/mtr_response_dto.py @@ -29,7 +29,7 @@ class MtrResponseDto(BaseModel): """ MtrResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: MtrMetaDto = Field(description="Metadata about the MTR test execution") diff --git a/geekflare_api/models/open_port_response_dto.py b/geekflare_api/models/open_port_response_dto.py index a47e601..f6ce9aa 100644 --- a/geekflare_api/models/open_port_response_dto.py +++ b/geekflare_api/models/open_port_response_dto.py @@ -28,7 +28,7 @@ class OpenPortResponseDto(BaseModel): """ OpenPortResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: OpenPortMetaDto = Field(description="Metadata about the request") diff --git a/geekflare_api/models/ping_response_dto.py b/geekflare_api/models/ping_response_dto.py index 02fce3c..6943228 100644 --- a/geekflare_api/models/ping_response_dto.py +++ b/geekflare_api/models/ping_response_dto.py @@ -29,7 +29,7 @@ class PingResponseDto(BaseModel): """ PingResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: PingMetaDto = Field(description="Metadata about the Ping test execution") diff --git a/geekflare_api/models/redirect_check_response_dto.py b/geekflare_api/models/redirect_check_response_dto.py index 9205533..645f526 100644 --- a/geekflare_api/models/redirect_check_response_dto.py +++ b/geekflare_api/models/redirect_check_response_dto.py @@ -29,7 +29,7 @@ class RedirectCheckResponseDto(BaseModel): """ RedirectCheckResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: RedirectCheckMetaDto = Field(description="Metadata about the redirection check.") diff --git a/geekflare_api/models/screenshot_dto.py b/geekflare_api/models/screenshot_dto.py index 35d4e98..4533ac2 100644 --- a/geekflare_api/models/screenshot_dto.py +++ b/geekflare_api/models/screenshot_dto.py @@ -48,7 +48,10 @@ class ScreenshotDto(BaseModel): quality: Optional[Union[Annotated[float, Field(le=100, strict=True, ge=10)], Annotated[int, Field(le=100, strict=True, ge=10)]]] = Field(default=None, description="Image quality (for JPEG/WEBP)", json_schema_extra={"examples": [90]}) scale_factor: Optional[Union[Annotated[float, Field(le=5, strict=True, ge=0.1)], Annotated[int, Field(le=5, strict=True, ge=1)]]] = Field(default=None, description="Device scale factor", alias="scaleFactor", json_schema_extra={"examples": [1]}) capture_beyond_viewport: Optional[StrictBool] = Field(default=None, description="Capture beyond viewport if possible", alias="captureBeyondViewport", json_schema_extra={"examples": [True]}) - __properties: ClassVar[List[str]] = ["url", "device", "proxyCountry", "type", "fullPage", "blockAds", "hideCookie", "skipCaptcha", "addTimestamp", "pageHeight", "viewportWidth", "viewportHeight", "theme", "removeBackground", "highlightLinks", "delay", "disableAnimations", "quality", "scaleFactor", "captureBeyondViewport"] + selector: Optional[StrictStr] = Field(default=None, description="CSS selector to capture only a specific element on the page. Supports class (.), ID (#), and attribute selectors.", json_schema_extra={"examples": [".hero-section"]}) + fallback_to_full_page: Optional[StrictBool] = Field(default=False, description="If true and the selector is not found, falls back to a full-page screenshot instead of returning an error. Default: false.", alias="fallbackToFullPage", json_schema_extra={"examples": [False]}) + inline: Optional[StrictBool] = Field(default=False, description="If true, includes a Base64-encoded image and data URI in the response. Useful for AI agents and LLMs that cannot fetch URLs. Default: false.", json_schema_extra={"examples": [False]}) + __properties: ClassVar[List[str]] = ["url", "device", "proxyCountry", "type", "fullPage", "blockAds", "hideCookie", "skipCaptcha", "addTimestamp", "pageHeight", "viewportWidth", "viewportHeight", "theme", "removeBackground", "highlightLinks", "delay", "disableAnimations", "quality", "scaleFactor", "captureBeyondViewport", "selector", "fallbackToFullPage", "inline"] @field_validator('device') def device_validate_enum(cls, value): @@ -150,7 +153,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "disableAnimations": obj.get("disableAnimations"), "quality": obj.get("quality"), "scaleFactor": obj.get("scaleFactor"), - "captureBeyondViewport": obj.get("captureBeyondViewport") + "captureBeyondViewport": obj.get("captureBeyondViewport"), + "selector": obj.get("selector"), + "fallbackToFullPage": obj.get("fallbackToFullPage") if obj.get("fallbackToFullPage") is not None else False, + "inline": obj.get("inline") if obj.get("inline") is not None else False }) return _obj diff --git a/geekflare_api/models/screenshot_inline_dto.py b/geekflare_api/models/screenshot_inline_dto.py new file mode 100644 index 0000000..87c877a --- /dev/null +++ b/geekflare_api/models/screenshot_inline_dto.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScreenshotInlineDto(BaseModel): + """ + ScreenshotInlineDto + """ # noqa: E501 + var_base64: StrictStr = Field(description="Raw Base64-encoded image string", alias="base64", json_schema_extra={"examples": ["iVBORw0KGgoAAAANSUhEUgAA..."]}) + data_uri: StrictStr = Field(description="Data URI — ready to embed in an tag or pass directly to an LLM", alias="dataUri", json_schema_extra={"examples": ["data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."]}) + __properties: ClassVar[List[str]] = ["base64", "dataUri"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScreenshotInlineDto from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScreenshotInlineDto from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "base64": obj.get("base64"), + "dataUri": obj.get("dataUri") + }) + return _obj + + diff --git a/geekflare_api/models/screenshot_meta_dto.py b/geekflare_api/models/screenshot_meta_dto.py index 611f374..36acdb4 100644 --- a/geekflare_api/models/screenshot_meta_dto.py +++ b/geekflare_api/models/screenshot_meta_dto.py @@ -48,8 +48,11 @@ class ScreenshotMetaDto(BaseModel): quality: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Image quality (JPEG/WEBP)", json_schema_extra={"examples": [90]}) scale_factor: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Device scale factor", alias="scaleFactor", json_schema_extra={"examples": [1]}) capture_beyond_viewport: Optional[StrictBool] = Field(default=None, description="Capture beyond viewport", alias="captureBeyondViewport", json_schema_extra={"examples": [True]}) + selector: Optional[StrictStr] = Field(default=None, description="CSS selector that was targeted, if provided", json_schema_extra={"examples": [".hero-section"]}) + fallback_to_full_page: Optional[StrictBool] = Field(default=None, description="Whether fallback to full-page was enabled", alias="fallbackToFullPage", json_schema_extra={"examples": [False]}) + inline: Optional[StrictBool] = Field(default=None, description="Whether inline base64 output was requested", json_schema_extra={"examples": [False]}) test: TestMetaDto = Field(description="Test details") - __properties: ClassVar[List[str]] = ["url", "type", "device", "fullPage", "blockAds", "hideCookie", "skipCaptcha", "addTimestamp", "proxyCountry", "pageHeight", "viewportWidth", "viewportHeight", "theme", "removeBackground", "highlightLinks", "delay", "disableAnimations", "quality", "scaleFactor", "captureBeyondViewport", "test"] + __properties: ClassVar[List[str]] = ["url", "type", "device", "fullPage", "blockAds", "hideCookie", "skipCaptcha", "addTimestamp", "proxyCountry", "pageHeight", "viewportWidth", "viewportHeight", "theme", "removeBackground", "highlightLinks", "delay", "disableAnimations", "quality", "scaleFactor", "captureBeyondViewport", "selector", "fallbackToFullPage", "inline", "test"] model_config = ConfigDict( validate_by_name=True, @@ -125,6 +128,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "quality": obj.get("quality"), "scaleFactor": obj.get("scaleFactor"), "captureBeyondViewport": obj.get("captureBeyondViewport"), + "selector": obj.get("selector"), + "fallbackToFullPage": obj.get("fallbackToFullPage"), + "inline": obj.get("inline"), "test": TestMetaDto.from_dict(obj["test"]) if obj.get("test") is not None else None }) return _obj diff --git a/geekflare_api/models/screenshot_response_dto.py b/geekflare_api/models/screenshot_response_dto.py index dfcfc6e..979ebf3 100644 --- a/geekflare_api/models/screenshot_response_dto.py +++ b/geekflare_api/models/screenshot_response_dto.py @@ -18,7 +18,8 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Union +from typing import Any, ClassVar, Dict, List, Optional, Union +from geekflare_api.models.screenshot_inline_dto import ScreenshotInlineDto from geekflare_api.models.screenshot_meta_dto import ScreenshotMetaDto from typing import Optional, Set from typing_extensions import Self @@ -28,12 +29,13 @@ class ScreenshotResponseDto(BaseModel): """ ScreenshotResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: ScreenshotMetaDto = Field(description="Metadata about the request") - data: StrictStr = Field(description="Screenshot URL or base64 string", json_schema_extra={"examples": ["https://geekflare.com/tests/screenshot/kbi6d206g87ituahb7icwtpr.png"]}) - __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] + data: StrictStr = Field(description="URL of the captured screenshot", json_schema_extra={"examples": ["https://geekflare.com/tests/screenshot/kbi6d206g87ituahb7icwtpr.png"]}) + inline: Optional[ScreenshotInlineDto] = Field(default=None, description="Inline Base64 image data. Present only when the request included `inline: true`.") + __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data", "inline"] @field_validator('api_status') def api_status_validate_enum(cls, value): @@ -84,6 +86,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of meta if self.meta: _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of inline + if self.inline: + _dict['inline'] = self.inline.to_dict() return _dict @classmethod @@ -100,7 +105,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "apiStatus": obj.get("apiStatus"), "apiCode": obj.get("apiCode"), "meta": ScreenshotMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, - "data": obj.get("data") + "data": obj.get("data"), + "inline": ScreenshotInlineDto.from_dict(obj["inline"]) if obj.get("inline") is not None else None }) return _obj diff --git a/geekflare_api/models/search200_response.py b/geekflare_api/models/search200_response.py index 47b0775..a1cb565 100644 --- a/geekflare_api/models/search200_response.py +++ b/geekflare_api/models/search200_response.py @@ -17,6 +17,7 @@ import pprint from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator from typing import Any, List, Optional +from geekflare_api.models.grounded_answer_response_dto import GroundedAnswerResponseDto from geekflare_api.models.image_search_response_dto import ImageSearchResponseDto from geekflare_api.models.search_html_response_dto import SearchHtmlResponseDto from geekflare_api.models.search_markdown_response_dto import SearchMarkdownResponseDto @@ -25,7 +26,7 @@ from typing import Union, List, Set, Optional, Dict from typing_extensions import Literal, Self -SEARCH200RESPONSE_ONE_OF_SCHEMAS = ["ImageSearchResponseDto", "SearchHtmlResponseDto", "SearchMarkdownResponseDto", "SearchResponseDto"] +SEARCH200RESPONSE_ONE_OF_SCHEMAS = ["GroundedAnswerResponseDto", "ImageSearchResponseDto", "SearchHtmlResponseDto", "SearchMarkdownResponseDto", "SearchResponseDto"] class Search200Response(BaseModel): """ @@ -39,8 +40,10 @@ class Search200Response(BaseModel): oneof_schema_3_validator: Optional[SearchMarkdownResponseDto] = None # data type: SearchHtmlResponseDto oneof_schema_4_validator: Optional[SearchHtmlResponseDto] = None - actual_instance: Optional[Union[ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto]] = None - one_of_schemas: Set[str] = { "ImageSearchResponseDto", "SearchHtmlResponseDto", "SearchMarkdownResponseDto", "SearchResponseDto" } + # data type: GroundedAnswerResponseDto + oneof_schema_5_validator: Optional[GroundedAnswerResponseDto] = None + actual_instance: Optional[Union[GroundedAnswerResponseDto, ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto]] = None + one_of_schemas: Set[str] = { "GroundedAnswerResponseDto", "ImageSearchResponseDto", "SearchHtmlResponseDto", "SearchMarkdownResponseDto", "SearchResponseDto" } model_config = ConfigDict( validate_assignment=True, @@ -83,12 +86,17 @@ def actual_instance_must_validate_oneof(cls, v): error_messages.append(f"Error! Input type `{type(v)}` is not `SearchHtmlResponseDto`") else: match += 1 + # validate data type: GroundedAnswerResponseDto + if not isinstance(v, GroundedAnswerResponseDto): + error_messages.append(f"Error! Input type `{type(v)}` is not `GroundedAnswerResponseDto`") + else: + match += 1 if match > 1: # more than 1 match - raise ValueError("Multiple matches found when setting `actual_instance` in Search200Response with oneOf schemas: ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when setting `actual_instance` in Search200Response with oneOf schemas: GroundedAnswerResponseDto, ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when setting `actual_instance` in Search200Response with oneOf schemas: ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting `actual_instance` in Search200Response with oneOf schemas: GroundedAnswerResponseDto, ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) else: return v @@ -127,13 +135,19 @@ def from_json(cls, json_str: str) -> Self: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) + # deserialize data into GroundedAnswerResponseDto + try: + instance.actual_instance = GroundedAnswerResponseDto.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) if match > 1: # more than 1 match - raise ValueError("Multiple matches found when deserializing the JSON string into Search200Response with oneOf schemas: ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) + raise ValueError("Multiple matches found when deserializing the JSON string into Search200Response with oneOf schemas: GroundedAnswerResponseDto, ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError("No match found when deserializing the JSON string into Search200Response with oneOf schemas: ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into Search200Response with oneOf schemas: GroundedAnswerResponseDto, ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto. Details: " + ", ".join(error_messages)) else: return instance @@ -147,7 +161,7 @@ def to_json(self) -> str: else: return json.dumps(self.actual_instance) - def to_dict(self) -> Optional[Union[Dict[str, Any], ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto]]: + def to_dict(self) -> Optional[Union[Dict[str, Any], GroundedAnswerResponseDto, ImageSearchResponseDto, SearchHtmlResponseDto, SearchMarkdownResponseDto, SearchResponseDto]]: """Returns the dict representation of the actual instance""" if self.actual_instance is None: return None diff --git a/geekflare_api/models/search_html_response_dto.py b/geekflare_api/models/search_html_response_dto.py index 0fa2cc2..926dfa3 100644 --- a/geekflare_api/models/search_html_response_dto.py +++ b/geekflare_api/models/search_html_response_dto.py @@ -28,7 +28,7 @@ class SearchHtmlResponseDto(BaseModel): """ SearchHtmlResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: SearchMetaDto diff --git a/geekflare_api/models/search_markdown_response_dto.py b/geekflare_api/models/search_markdown_response_dto.py index 56eaa63..a8ba4bc 100644 --- a/geekflare_api/models/search_markdown_response_dto.py +++ b/geekflare_api/models/search_markdown_response_dto.py @@ -28,7 +28,7 @@ class SearchMarkdownResponseDto(BaseModel): """ SearchMarkdownResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: SearchMetaDto diff --git a/geekflare_api/models/search_request_dto.py b/geekflare_api/models/search_request_dto.py index 0814dc8..5a0dc42 100644 --- a/geekflare_api/models/search_request_dto.py +++ b/geekflare_api/models/search_request_dto.py @@ -39,7 +39,8 @@ class SearchRequestDto(BaseModel): format: Optional[StrictStr] = Field(default='json', description="Output format") scrape: Optional[StrictBool] = Field(default=False, description="scrape and extract content from SERP result URLs", json_schema_extra={"examples": [False]}) scrape_limit: Optional[Union[Annotated[float, Field(le=10, strict=True, ge=1)], Annotated[int, Field(le=10, strict=True, ge=1)]]] = Field(default=3, description="Number of URLs to scrape (requires scrape: true)", alias="scrapeLimit", json_schema_extra={"examples": [3]}) - __properties: ClassVar[List[str]] = ["query", "limit", "time", "location", "source", "category", "includeDomains", "excludeDomains", "format", "scrape", "scrapeLimit"] + grounded_answer: Optional[StrictBool] = Field(default=False, description="Use AI to synthesize a grounded answer from search results.", alias="groundedAnswer", json_schema_extra={"examples": [False]}) + __properties: ClassVar[List[str]] = ["query", "limit", "time", "location", "source", "category", "includeDomains", "excludeDomains", "format", "scrape", "scrapeLimit", "groundedAnswer"] @field_validator('source') def source_validate_enum(cls, value): @@ -132,7 +133,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "excludeDomains": obj.get("excludeDomains"), "format": obj.get("format") if obj.get("format") is not None else 'json', "scrape": obj.get("scrape") if obj.get("scrape") is not None else False, - "scrapeLimit": obj.get("scrapeLimit") if obj.get("scrapeLimit") is not None else 3 + "scrapeLimit": obj.get("scrapeLimit") if obj.get("scrapeLimit") is not None else 3, + "groundedAnswer": obj.get("groundedAnswer") if obj.get("groundedAnswer") is not None else False }) return _obj diff --git a/geekflare_api/models/search_response_dto.py b/geekflare_api/models/search_response_dto.py index d63d354..abac90c 100644 --- a/geekflare_api/models/search_response_dto.py +++ b/geekflare_api/models/search_response_dto.py @@ -29,7 +29,7 @@ class SearchResponseDto(BaseModel): """ SearchResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: SearchMetaDto diff --git a/geekflare_api/models/search_result_item_dto.py b/geekflare_api/models/search_result_item_dto.py index bb19b96..b7dfdc3 100644 --- a/geekflare_api/models/search_result_item_dto.py +++ b/geekflare_api/models/search_result_item_dto.py @@ -33,7 +33,8 @@ class SearchResultItemDto(BaseModel): var_date: Optional[StrictStr] = Field(default=None, description="Published date (if available)", alias="date", json_schema_extra={"examples": ["Dec 18, 2025"]}) position: Union[StrictFloat, StrictInt] = Field(description="Rank position", json_schema_extra={"examples": [1]}) content: Optional[Dict[str, Any]] = Field(default=None, description="Scraped cleaned HTML content from the result URL", json_schema_extra={"examples": ["Full article cleaned for LLM consumption..."]}) - __properties: ClassVar[List[str]] = ["title", "url", "snippet", "date", "position", "content"] + thumbnail: Optional[Dict[str, Any]] = Field(default=None, description="Thumbnail image URL (if available)", json_schema_extra={"examples": ["https://example.com/thumb.jpg"]}) + __properties: ClassVar[List[str]] = ["title", "url", "snippet", "date", "position", "content", "thumbnail"] model_config = ConfigDict( validate_by_name=True, @@ -91,7 +92,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "snippet": obj.get("snippet"), "date": obj.get("date"), "position": obj.get("position"), - "content": obj.get("content") + "content": obj.get("content"), + "thumbnail": obj.get("thumbnail") }) return _obj diff --git a/geekflare_api/models/service_health_response_dto.py b/geekflare_api/models/service_health_response_dto.py index f2ada53..0d7a9ee 100644 --- a/geekflare_api/models/service_health_response_dto.py +++ b/geekflare_api/models/service_health_response_dto.py @@ -28,7 +28,7 @@ class ServiceHealthResponseDto(BaseModel): """ ServiceHealthResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) message: StrictStr = Field(description="Top-level message summarizing the overall health check", json_schema_extra={"examples": ["Service health check completed"]}) diff --git a/geekflare_api/models/site_status_response_dto.py b/geekflare_api/models/site_status_response_dto.py index 3907f7a..7545830 100644 --- a/geekflare_api/models/site_status_response_dto.py +++ b/geekflare_api/models/site_status_response_dto.py @@ -28,7 +28,7 @@ class SiteStatusResponseDto(BaseModel): """ SiteStatusResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) message: StrictStr = Field(description="Indicates the current status of the site. It can either be \"Site is up\" or \"Unable to reach the URL.\"", json_schema_extra={"examples": ["Site is up"]}) diff --git a/geekflare_api/models/tls_scan_response_dto.py b/geekflare_api/models/tls_scan_response_dto.py index 6680ea0..6522881 100644 --- a/geekflare_api/models/tls_scan_response_dto.py +++ b/geekflare_api/models/tls_scan_response_dto.py @@ -29,7 +29,7 @@ class TlsScanResponseDto(BaseModel): """ TlsScanResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: TlsScanMetaDto = Field(description="Metadata about the TLS scan request") diff --git a/geekflare_api/models/url2_pdf_response_dto.py b/geekflare_api/models/url2_pdf_response_dto.py index c29376b..1d5c211 100644 --- a/geekflare_api/models/url2_pdf_response_dto.py +++ b/geekflare_api/models/url2_pdf_response_dto.py @@ -28,7 +28,7 @@ class Url2PdfResponseDto(BaseModel): """ Url2PdfResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: Url2PdfMetaDto = Field(description="Metadata about the request") diff --git a/geekflare_api/models/web_scrape_response_dto.py b/geekflare_api/models/web_scrape_response_dto.py index a55fc95..f74059e 100644 --- a/geekflare_api/models/web_scrape_response_dto.py +++ b/geekflare_api/models/web_scrape_response_dto.py @@ -19,8 +19,8 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Union -from geekflare_api.models.meta_scrape_response_dto_data import MetaScrapeResponseDtoData from geekflare_api.models.web_scrape_meta_dto import WebScrapeMetaDto +from geekflare_api.models.web_scrape_response_dto_data import WebScrapeResponseDtoData from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python @@ -29,11 +29,11 @@ class WebScrapeResponseDto(BaseModel): """ WebScrapeResponseDto """ # noqa: E501 - timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1777874383873]}) + timestamp: Union[StrictFloat, StrictInt] = Field(description="Timestamp of the request in milliseconds", json_schema_extra={"examples": [1783063255117]}) api_status: StrictStr = Field(description="API status message", alias="apiStatus", json_schema_extra={"examples": ["success"]}) api_code: Union[StrictFloat, StrictInt] = Field(description="API status code", alias="apiCode", json_schema_extra={"examples": [200]}) meta: WebScrapeMetaDto = Field(description="Metadata about the request") - data: MetaScrapeResponseDtoData + data: WebScrapeResponseDtoData __properties: ClassVar[List[str]] = ["timestamp", "apiStatus", "apiCode", "meta", "data"] @field_validator('api_status') @@ -104,7 +104,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "apiStatus": obj.get("apiStatus"), "apiCode": obj.get("apiCode"), "meta": WebScrapeMetaDto.from_dict(obj["meta"]) if obj.get("meta") is not None else None, - "data": MetaScrapeResponseDtoData.from_dict(obj["data"]) if obj.get("data") is not None else None + "data": WebScrapeResponseDtoData.from_dict(obj["data"]) if obj.get("data") is not None else None }) return _obj diff --git a/geekflare_api/models/web_scrape_response_dto_data.py b/geekflare_api/models/web_scrape_response_dto_data.py new file mode 100644 index 0000000..f167455 --- /dev/null +++ b/geekflare_api/models/web_scrape_response_dto_data.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, Dict, List, Optional +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +WEBSCRAPERESPONSEDTODATA_ONE_OF_SCHEMAS = ["object", "str"] + +class WebScrapeResponseDtoData(BaseModel): + """ + Scraped data (URL or inline content depending on output) + """ + # data type: str + oneof_schema_1_validator: Optional[StrictStr] = None + # data type: object + oneof_schema_2_validator: Optional[Dict[str, Any]] = None + actual_instance: Optional[Union[object, str]] = None + one_of_schemas: Set[str] = { "object", "str" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = WebScrapeResponseDtoData.model_construct() + error_messages = [] + match = 0 + # validate data type: str + try: + instance.oneof_schema_1_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # validate data type: object + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in WebScrapeResponseDtoData with oneOf schemas: object, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in WebScrapeResponseDtoData with oneOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into str + try: + # validation + instance.oneof_schema_1_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_1_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into object + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into WebScrapeResponseDtoData with oneOf schemas: object, str. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into WebScrapeResponseDtoData with oneOf schemas: object, str. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], object, str]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/openapi.json b/openapi.json deleted file mode 100644 index 61a1b33..0000000 --- a/openapi.json +++ /dev/null @@ -1,4138 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Geekflare API", - "description": "Official OpenAPI specification for all Geekflare API endpoints.", - "version": "1.0.0", - "license": { "name": "MIT" } - }, - "servers": [{ "url": "https://api.geekflare.com" }], - "security": [ - { - "x-api-key": [] - } - ], - "paths": { - "/metascraping": { - "post": { - "operationId": "metaScrape", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MetaScrapeDto" - } - } - } - }, - "responses": { - "200": { - "description": "Successfully scraped webpage meta", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MetaScrapeResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Scrape a webpage meta with custom options", - "tags": ["api-tool"] - } - }, - "/webscraping": { - "post": { - "operationId": "webScrape", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebScrapeDto" - } - } - } - }, - "responses": { - "200": { - "description": "Successfully scraped webpage", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/WebScrapeResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Scrape a webpage with custom options", - "tags": ["api-tool"] - } - }, - "/dnsrecord": { - "post": { - "operationId": "dnsRecord", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DnsRecordDto" - } - } - } - }, - "responses": { - "200": { - "description": "Successfully retrieved DNS records", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DnsRecordResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Retrieve DNS records for a given domain", - "tags": ["api-tool"] - } - }, - "/screenshot": { - "post": { - "operationId": "screenshot", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScreenshotDto" - } - } - } - }, - "responses": { - "200": { - "description": "Successfully captured screenshot", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ScreenshotResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (e.g. invalid URL or parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error while capturing screenshot", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Capture a full-page screenshot of a website", - "tags": ["api-tool"] - } - }, - "/up": { - "post": { - "operationId": "siteStatus", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SiteStatusDto" - } - } - } - }, - "responses": { - "200": { - "description": "Site status retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SiteStatusResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Check if a site is up or down", - "tags": ["api-tool"] - } - }, - "/redirectcheck": { - "post": { - "operationId": "redirectCheck", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RedirectCheckDto" - } - } - } - }, - "responses": { - "200": { - "description": "Successfully retrieved redirect chain", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RedirectCheckResponseDto" - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Check the redirection chain of a given URL", - "tags": ["api-tool"] - } - }, - "/brokenlink": { - "post": { - "operationId": "brokenLink", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BrokenLinkDto" - } - } - } - }, - "responses": { - "200": { - "description": "Successfully checked for broken links", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BrokenLinkResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Check if a webpage contains broken links", - "tags": ["api-tool"] - } - }, - "/url2pdf": { - "post": { - "operationId": "url2Pdf", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Url2PdfDto" - } - } - } - }, - "responses": { - "200": { - "description": "Successfully captured Url2Pdf", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Url2PdfResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (e.g. invalid URL or parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error while capturing Url2Pdf", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Capture a full-page Url2Pdf of a website", - "tags": ["api-tool"] - } - }, - "/openport": { - "post": { - "operationId": "openPorts", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenPortDto" - } - } - } - }, - "responses": { - "200": { - "description": "Open ports retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenPortResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Scan a website for open ports", - "tags": ["api-tool"] - } - }, - "/tlsscan": { - "post": { - "operationId": "tlsScan", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TlsScanDto" - } - } - } - }, - "responses": { - "200": { - "description": "Successfully retrieved TLS scan information", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/TlsScanResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Perform TLS scan for a given domain", - "tags": ["api-tool"] - } - }, - "/loadtime": { - "post": { - "operationId": "loadTime", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoadTimeDto" - } - } - } - }, - "responses": { - "200": { - "description": "Load time retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LoadTimeResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Measure the page load time for a given URL", - "tags": ["api-tool"] - } - }, - "/mixedcontent": { - "post": { - "operationId": "mixedContent", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MixedContentDto" - } - } - } - }, - "responses": { - "200": { - "description": "Site status retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MixedContentResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Check for mixed content on a site", - "tags": ["api-tool"] - } - }, - "/dnssec": { - "post": { - "operationId": "dnsSec", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DnsSecDto" - } - } - } - }, - "responses": { - "200": { - "description": "DNSSEC test result retrieved successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DnsSecResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Check if DNSSEC is enabled for a domain", - "tags": ["api-tool"] - } - }, - "/mtr": { - "post": { - "operationId": "mtr", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MtrDto" - } - } - } - }, - "responses": { - "200": { - "description": "MTR test completed successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/MtrResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Perform MTR (My Traceroute) network diagnostic test", - "tags": ["api-tool"] - } - }, - "/ping": { - "post": { - "operationId": "ping", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PingDto" - } - } - } - }, - "responses": { - "200": { - "description": "Ping test completed successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/PingResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (invalid parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Perform ICMP Ping test on a given URL or IP", - "tags": ["api-tool"] - } - }, - "/lighthouse": { - "post": { - "operationId": "lighthouse", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LighthouseDto" - } - } - } - }, - "responses": { - "200": { - "description": "Successfully ran Lighthouse audit", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LighthouseResponseDto" - } - } - } - }, - "400": { - "description": "Bad request (e.g. invalid URL or parameters)", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error while running Lighthouse audit", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Run Lighthouse audit on a website", - "tags": ["api-tool"] - } - }, - "/search": { - "post": { - "description": "Search the web for AI, remove noise like ads and unnecessary HTML, and return clean data in JSON, Markdown, or HTML formats, with support for image search and news.", - "operationId": "search", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SearchRequestDto" - } - } - } - }, - "responses": { - "200": { - "description": "Search results (format depends on request)", - "content": { - "application/json": { - "schema": { - "oneOf": [ - { - "$ref": "#/components/schemas/SearchResponseDto" - }, - { - "$ref": "#/components/schemas/ImageSearchResponseDto" - }, - { - "$ref": "#/components/schemas/SearchMarkdownResponseDto" - }, - { - "$ref": "#/components/schemas/SearchHtmlResponseDto" - } - ] - } - } - } - }, - "400": { - "description": "Bad request", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - }, - "500": { - "description": "Internal server error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/BaseErrorResponseDto" - } - } - } - } - }, - "summary": "Search API for AI Agents & LLMs", - "tags": ["api-tool"] - } - } - }, - "components": { - "securitySchemes": { - "x-api-key": { - "type": "apiKey", - "in": "header", - "name": "x-api-key", - "description": "API Key required for all endpoints" - } - }, - "schemas": { - "MetaScrapeDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "device": { - "type": "string", - "description": "Device type to emulate. Defaults to desktop.", - "example": "desktop", - "enum": ["desktop", "mobile"], - "default": "desktop" - }, - "blockAds": { - "type": "boolean", - "description": "Whether to block ads", - "example": true, - "default": true - }, - "renderJS": { - "type": "boolean", - "description": "Whether to render JavaScript", - "example": true, - "default": true - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - }, - "format": { - "type": "string", - "description": "Format of the scraped result. Defaults to html.", - "example": "json", - "enum": ["markdown", "json"], - "default": "json" - }, - "fileOutput": { - "type": "boolean", - "description": "Whether to get response in file format", - "example": false, - "default": false - } - }, - "required": ["url"] - }, - "TestMetaDto": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Unique test identifier", - "example": "mxqx9v9y0742lap6altwdteqd28t23nq" - } - }, - "required": ["id"] - }, - "MetaScrapeMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The target URL that was scraped", - "example": "https://example.com" - }, - "device": { - "type": "string", - "description": "Device type used", - "example": "desktop", - "enum": ["desktop", "mobile"] - }, - "format": { - "type": "string", - "description": "Output format of the result", - "example": "json", - "enum": ["markdown", "json"] - }, - "fileOutput": { - "type": "boolean", - "description": "Whether to get response in file format", - "example": false - }, - "blockAds": { - "type": "boolean", - "description": "Whether ads were blocked", - "example": true - }, - "renderJS": { - "type": "boolean", - "description": "Whether JavaScript was rendered", - "example": true - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country used, if any" - }, - "test": { - "description": "Test details object", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": [ - "url", - "device", - "format", - "fileOutput", - "blockAds", - "renderJS", - "test" - ] - }, - "MetaScrapeResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the request", - "allOf": [ - { - "$ref": "#/components/schemas/MetaScrapeMetaDto" - } - ] - }, - "data": { - "description": "Scraped data (URL or inline content depending on output)", - "example": "https://example.com/9bulgk075ed9m3vhua5vcrp0.html", - "oneOf": [ - { - "type": "string" - }, - { - "type": "object" - } - ] - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "BaseErrorResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "message": { - "type": "string", - "description": "Error message", - "example": "Invalid URL provided" - }, - "details": { - "type": "string", - "description": "Detailed error information", - "example": "The URL must be a valid HTTP or HTTPS URL" - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "message"] - }, - "DefaultExtractionFieldDto": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "Title/key of the extracted field", - "example": "Product Name" - }, - "value": { - "type": "object", - "description": "Static value to assign to this field", - "example": "Some hardcoded string" - } - }, - "required": ["title", "value"] - }, - "SelectorExtractionFieldDto": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Field name in the extracted JSON", - "example": "title" - }, - "selector": { - "type": "string", - "description": "Selector or XPath to extract value", - "example": "h1.product-title" - }, - "type": { - "type": "string", - "description": "Type of data to extract", - "example": "text" - }, - "attribute": { - "type": "string", - "description": "If type=attr, specify attribute name", - "example": "href" - }, - "fields": { - "description": "Nested fields", - "type": "array", - "items": { - "$ref": "#/components/schemas/SelectorExtractionFieldDto" - } - } - }, - "required": ["name", "selector", "type"] - }, - "ExtractionSchemaDto": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name/Label for this extraction schema", - "example": "Product Schema" - }, - "baseSelector": { - "type": "string", - "description": "Base selector for scoping extraction (css/xpath only)", - "example": ".product" - }, - "fields": { - "type": "array", - "description": "List of fields to extract", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/DefaultExtractionFieldDto" - }, - { - "$ref": "#/components/schemas/SelectorExtractionFieldDto" - } - ] - } - } - }, - "required": ["name", "fields"] - }, - "WebScrapeDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "device": { - "type": "string", - "description": "Device type to emulate. Defaults to desktop.", - "example": "desktop", - "enum": ["desktop", "mobile"], - "default": "desktop" - }, - "blockAds": { - "type": "boolean", - "description": "Whether to block ads", - "example": true, - "default": true - }, - "renderJS": { - "type": "boolean", - "description": "Whether to render JavaScript", - "example": true, - "default": true - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - }, - "format": { - "type": "array", - "description": "Format(s) of the scraped result. Comma-separated or array. Defaults to html.", - "example": "html,markdown", - "default": ["html-llm"], - "items": { - "type": "string", - "enum": [ - "html", - "markdown", - "json", - "markdown-llm", - "html-llm", - "text", - "text-llm" - ] - } - }, - "fileOutput": { - "type": "boolean", - "description": "Whether to get response in file format", - "example": false, - "default": false - }, - "stealth": { - "type": "boolean", - "description": "Enable stealth mode to bypass basic bot detection (removes webdriver signals, patches navigator properties)", - "example": false, - "default": false - }, - "waitTime": { - "type": "number", - "description": "Seconds to wait after page load before capturing content. Helps bypass lazy-loaded content and bot checks.", - "example": 2.5, - "default": 0 - }, - "extractionMode": { - "type": "string", - "description": "Extraction mode (only used if format=json)", - "example": "default", - "enum": ["default", "cssSchema", "xpathSchema"], - "default": "default" - }, - "extractionSchema": { - "description": "Extraction schema (optional in default mode, required in css/xpath)", - "examples": { - "default": { - "summary": "Default Mode Schema", - "value": { - "name": "Quick Fields", - "fields": [ - { - "title": "Category", - "value": "Electronics" - }, - { - "title": "Country", - "value": "India" - } - ] - } - }, - "cssSchema": { - "summary": "CSS Schema", - "value": { - "name": "Product Schema", - "baseSelector": ".product", - "fields": [ - { - "name": "title", - "selector": "h1.product-title", - "type": "text" - }, - { - "name": "price", - "selector": ".price", - "type": "text" - } - ] - } - }, - "xpathSchema": { - "summary": "XPath Schema", - "value": { - "name": "Article Schema", - "baseSelector": "//div[@class='article']", - "fields": [ - { - "name": "title", - "selector": "//h1/text()", - "type": "text" - } - ] - } - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/ExtractionSchemaDto" - } - ] - } - }, - "required": ["url"] - }, - "WebScrapeMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The target URL that was scraped", - "example": "https://example.com" - }, - "device": { - "type": "string", - "description": "Device type used", - "example": "desktop", - "enum": ["desktop", "mobile"] - }, - "format": { - "type": "array", - "description": "Output format(s) of the result", - "example": ["html-llm"], - "items": { - "type": "string", - "enum": [ - "html", - "markdown", - "json", - "markdown-llm", - "html-llm", - "text", - "text-llm" - ] - } - }, - "fileOutput": { - "type": "boolean", - "description": "Whether to get response in file format", - "example": false - }, - "blockAds": { - "type": "boolean", - "description": "Whether ads were blocked", - "example": true - }, - "renderJS": { - "type": "boolean", - "description": "Whether JavaScript was rendered", - "example": true - }, - "stealth": { - "type": "boolean", - "description": "Whether stealth mode was enabled", - "example": false - }, - "waitTime": { - "type": "number", - "description": "Seconds to wait after page load before capturing content. Helps bypass lazy-loaded content and bot checks.", - "example": 2.5, - "default": 0 - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country used, if any" - }, - "extractionMode": { - "type": "string", - "description": "Extraction mode (only used if format=json)", - "example": "default" - }, - "extractionSchema": { - "description": "Extraction schema (optional in default mode, required in css/xpath)", - "examples": { - "default": { - "summary": "Default Mode Schema", - "value": { - "name": "Quick Fields", - "fields": [ - { - "title": "Category", - "value": "Electronics" - }, - { - "title": "Country", - "value": "India" - } - ] - } - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/ExtractionSchemaDto" - } - ] - }, - "test": { - "description": "Test details object", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": [ - "url", - "device", - "format", - "fileOutput", - "blockAds", - "renderJS", - "stealth", - "waitTime", - "extractionMode", - "extractionSchema", - "test" - ] - }, - "WebScrapeResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the request", - "allOf": [ - { - "$ref": "#/components/schemas/WebScrapeMetaDto" - } - ] - }, - "data": { - "description": "Scraped data (URL or inline content depending on output)", - "example": "https://example.com/9bulgk075ed9m3vhua5vcrp0.html", - "oneOf": [ - { - "type": "string" - }, - { - "type": "object" - } - ] - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "DnsRecordDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "types": { - "type": "array", - "description": "List of DNS record types to query. If omitted, all supported types will be returned.", - "example": ["A", "MX"], - "items": { - "type": "string", - "enum": [ - "A", - "AAAA", - "CNAME", - "MX", - "CAA", - "NS", - "SOA", - "SRV", - "TXT" - ] - } - } - }, - "required": ["url"] - }, - "DnsMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The target URL that was scraped", - "example": "https://example.com" - }, - "types": { - "type": "string", - "description": "List of DNS record types to query. If omitted, all supported types will be returned.", - "example": ["A", "MX"], - "enum": [ - "A", - "AAAA", - "CNAME", - "MX", - "CAA", - "NS", - "SOA", - "SRV", - "TXT" - ] - }, - "test": { - "description": "Test details object", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "types", "test"] - }, - "DnsRecordResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the request.", - "example": { - "url": "example.com", - "types": ["A", "MX"], - "test": { - "id": "zmkqoxxu075dwn4u61yoqhq2rwo0029m" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/DnsMetaDto" - } - ] - }, - "data": { - "type": "object", - "description": "DNS records grouped by type.", - "example": { - "A": ["172.67.70.213", "104.26.11.88", "104.26.10.88"], - "MX": [ - { - "exchange": "alt3.aspmx.l.google.com", - "priority": 10 - }, - { - "exchange": "aspmx.l.google.com", - "priority": 1 - } - ] - } - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "ScreenshotDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "device": { - "type": "string", - "description": "Device type to emulate. Defaults to desktop.", - "example": "desktop", - "enum": ["desktop", "mobile"], - "default": "desktop" - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - }, - "type": { - "type": "string", - "description": "File type of screenshot. Defaults to png.", - "example": "png", - "enum": ["png", "jpeg", "webp"], - "default": "png" - }, - "fullPage": { - "type": "boolean", - "description": "Take full-page screenshot", - "example": true, - "default": false - }, - "blockAds": { - "type": "boolean", - "description": "Block ads on the page", - "example": true, - "default": true - }, - "hideCookie": { - "type": "boolean", - "description": "Hide cookie popups", - "example": true, - "default": true - }, - "skipCaptcha": { - "type": "boolean", - "description": "Try to bypass captcha", - "example": true, - "default": true - }, - "addTimestamp": { - "type": "boolean", - "description": "Add timestamp watermark", - "example": true, - "default": false - }, - "pageHeight": { - "type": "number", - "description": "Height of the page (for partial screenshot)", - "example": 2000, - "minimum": 100, - "maximum": 5000 - }, - "viewportWidth": { - "type": "number", - "description": "Width of the viewport", - "example": 1280, - "minimum": 320, - "maximum": 3840 - }, - "viewportHeight": { - "type": "number", - "description": "Height of the viewport", - "example": 800, - "minimum": 240, - "maximum": 2160 - }, - "theme": { - "type": "string", - "description": "Theme to use for rendering", - "example": "auto", - "enum": ["light", "dark", "auto"], - "default": "auto" - }, - "removeBackground": { - "type": "boolean", - "description": "Remove background from screenshot", - "example": false - }, - "highlightLinks": { - "type": "boolean", - "description": "Highlight links on the page", - "example": false - }, - "delay": { - "type": "number", - "description": "Delay before taking screenshot (in seconds)", - "example": 2, - "minimum": 0, - "maximum": 10 - }, - "disableAnimations": { - "type": "boolean", - "description": "Disable animations on the page", - "example": false - }, - "quality": { - "type": "number", - "description": "Image quality (for JPEG/WEBP)", - "example": 90, - "minimum": 10, - "maximum": 100 - }, - "scaleFactor": { - "type": "number", - "description": "Device scale factor", - "example": 1, - "minimum": 0.1, - "maximum": 5 - }, - "captureBeyondViewport": { - "type": "boolean", - "description": "Capture beyond viewport if possible", - "example": true - } - }, - "required": ["url"] - }, - "ScreenshotMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The target URL that was captured", - "example": "https://example.com" - }, - "type": { - "type": "string", - "description": "File type of screenshot", - "example": "png" - }, - "device": { - "type": "string", - "description": "Device type used", - "example": "desktop" - }, - "fullPage": { - "type": "boolean", - "description": "Whether full-page screenshot was taken", - "example": false - }, - "blockAds": { - "type": "boolean", - "description": "Whether ads were blocked", - "example": false - }, - "hideCookie": { - "type": "boolean", - "description": "Whether cookie popups were hidden", - "example": false - }, - "skipCaptcha": { - "type": "boolean", - "description": "Whether captcha was bypassed", - "example": false - }, - "addTimestamp": { - "type": "boolean", - "description": "Whether timestamp watermark was added", - "example": false - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country used, if any" - }, - "pageHeight": { - "type": "number", - "description": "Height of the page", - "example": 2000 - }, - "viewportWidth": { - "type": "number", - "description": "Width of the viewport", - "example": 1280 - }, - "viewportHeight": { - "type": "number", - "description": "Height of the viewport", - "example": 800 - }, - "theme": { - "type": "string", - "description": "Theme used", - "example": "auto" - }, - "removeBackground": { - "type": "boolean", - "description": "Whether background was removed", - "example": false - }, - "highlightLinks": { - "type": "boolean", - "description": "Whether links were highlighted", - "example": false - }, - "delay": { - "type": "number", - "description": "Delay before screenshot", - "example": 2 - }, - "disableAnimations": { - "type": "boolean", - "description": "Whether animations were disabled", - "example": false - }, - "quality": { - "type": "number", - "description": "Image quality (JPEG/WEBP)", - "example": 90 - }, - "scaleFactor": { - "type": "number", - "description": "Device scale factor", - "example": 1 - }, - "captureBeyondViewport": { - "type": "boolean", - "description": "Capture beyond viewport", - "example": true - }, - "test": { - "description": "Test details", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": [ - "url", - "type", - "device", - "fullPage", - "blockAds", - "hideCookie", - "skipCaptcha", - "addTimestamp", - "test" - ] - }, - "ScreenshotResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the request", - "allOf": [ - { - "$ref": "#/components/schemas/ScreenshotMetaDto" - } - ] - }, - "data": { - "type": "string", - "description": "Screenshot URL or base64 string", - "example": "https://geekflare.com/tests/screenshot/kbi6d206g87ituahb7icwtpr.png" - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "SiteStatusDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - }, - "followRedirect": { - "type": "boolean", - "description": "Whether to follow redirects when checking site status", - "example": false, - "default": false - } - }, - "required": ["url"] - }, - "SiteStatusMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The target URL checked", - "example": "https://example.com" - }, - "followRedirect": { - "type": "boolean", - "description": "Whether redirects were followed", - "example": true - }, - "redirectedURL": { - "type": "object", - "description": "Final redirected URL (if applicable)", - "example": "https://www.example.com/home" - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country used (if any)", - "example": "US" - }, - "test": { - "description": "Test details object", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "followRedirect", "proxyCountry", "test"] - }, - "SiteStatusResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "message": { - "type": "string", - "description": "Indicates the current status of the site. It can either be \"Site is up\" or \"Unable to reach the URL.\"", - "example": "Site is up" - }, - "meta": { - "description": "Metadata about the site status check.", - "example": { - "url": "example.com", - "proxyCountry": "US", - "followRedirect": true, - "redirectedURL": "https://www.example.com", - "test": { - "id": "zmkqoxxu075dwn4u61yoqhq2rwo0029m" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/SiteStatusMetaDto" - } - ] - }, - "data": { - "type": "object", - "description": "HTTP status information from the site check.", - "example": { - "statusCode": 200, - "reasonPhrase": "OK" - } - } - }, - "required": [ - "timestamp", - "apiStatus", - "apiCode", - "message", - "meta", - "data" - ] - }, - "RedirectCheckDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - } - }, - "required": ["url"] - }, - "RedirectCheckMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The original URL checked", - "example": "example.com" - }, - "proxyCountry": { - "type": "object", - "description": "Proxy country used (if any)", - "example": "US" - }, - "test": { - "description": "Test details object", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "proxyCountry", "test"] - }, - "RedirectHopDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The URL at this hop", - "example": "http://example.com/" - }, - "status": { - "type": "number", - "description": "HTTP status code at this hop", - "example": 301 - }, - "headers": { - "description": "Response headers", - "example": [ - { - "name": "location", - "value": "https://example.com/" - }, - { - "name": "date", - "value": "Mon, 29 Aug 2022 07:17:31 GMT" - } - ], - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["url", "status", "headers"] - }, - "RedirectCheckResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the redirection check.", - "example": { - "url": "example.com", - "proxyCountry": "United States", - "test": { - "id": "667zexrk0aaiabz2rx95b2cxm0khc2s0" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/RedirectCheckMetaDto" - } - ] - }, - "data": { - "description": "List of redirection hops with status and headers.", - "type": "array", - "items": { - "$ref": "#/components/schemas/RedirectHopDto" - } - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "BrokenLinkDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - }, - "followRedirect": { - "type": "boolean", - "description": "Whether to follow redirects when checking site status", - "example": false, - "default": false - } - }, - "required": ["url"] - }, - "BrokenLinkMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The target URL checked for broken links", - "example": "example.com" - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country used for this request", - "example": "United States" - }, - "followRedirect": { - "type": "boolean", - "description": "Whether redirection was followed", - "example": true - }, - "redirectedURL": { - "type": "string", - "description": "Final URL after redirection (if any)", - "example": "https://example.com/" - }, - "test": { - "description": "Test details object", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": [ - "url", - "proxyCountry", - "followRedirect", - "redirectedURL", - "test" - ] - }, - "BrokenLinkSummaryDto": { - "type": "object", - "properties": { - "total": { - "type": "number", - "description": "Total number of links checked", - "example": 5 - }, - "successful": { - "type": "number", - "description": "Number of successful links (2xx status codes)", - "example": 2 - }, - "redirects": { - "type": "number", - "description": "Number of redirect links (3xx status codes)", - "example": 2 - }, - "broken": { - "type": "number", - "description": "Number of broken links (4xx status codes and DNS/network failures)", - "example": 1 - }, - "serverError": { - "type": "number", - "description": "Number of server errors (5xx status codes)", - "example": 0 - } - }, - "required": [ - "total", - "successful", - "redirects", - "broken", - "serverError" - ] - }, - "BrokenLinkResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "message": { - "type": "string", - "description": "Human-readable message about the broken link scan result", - "example": "No broken links found." - }, - "meta": { - "description": "Metadata about the broken link request", - "example": { - "url": "example.com", - "proxyCountry": "United States", - "followRedirect": true, - "redirectedURL": "https://example.com/", - "test": { - "id": "wf0b7yrn05br8xtwple7ngj7hhxzvl2e" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/BrokenLinkMetaDto" - } - ] - }, - "summary": { - "description": "Summary of link check results categorized by status", - "example": { - "total": 5, - "successful": 2, - "redirects": 2, - "broken": 1, - "serverError": 0 - }, - "allOf": [ - { - "$ref": "#/components/schemas/BrokenLinkSummaryDto" - } - ] - }, - "data": { - "description": "List of links found on the page and their HTTP status", - "example": [ - { - "link": "https://example.com/", - "status": 200 - }, - { - "link": "https://example.com/articles", - "status": 200 - } - ], - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "timestamp", - "apiStatus", - "apiCode", - "message", - "meta", - "summary", - "data" - ] - }, - "MarginDto": { - "type": "object", - "properties": { - "top": { - "type": "number", - "description": "Top margin in mm", - "example": 25.4 - }, - "bottom": { - "type": "number", - "description": "Bottom margin in mm", - "example": 25.4 - }, - "right": { - "type": "number", - "description": "Right margin in mm", - "example": 25.4 - }, - "left": { - "type": "number", - "description": "Left margin in mm", - "example": 25.4 - } - } - }, - "Url2PdfDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "device": { - "type": "string", - "description": "Device type to emulate. Defaults to desktop.", - "example": "desktop", - "enum": ["desktop", "mobile"], - "default": "desktop" - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - }, - "format": { - "type": "string", - "description": "Paper format", - "example": "a4", - "enum": [ - "letter", - "legal", - "a0", - "a1", - "a2", - "a3", - "a4", - "a5", - "a6" - ], - "default": "a4" - }, - "orientation": { - "type": "string", - "description": "Orientation", - "example": "portrait", - "enum": ["portrait", "landscape"], - "default": "portrait" - }, - "margin": { - "description": "Margins in mm", - "allOf": [ - { - "$ref": "#/components/schemas/MarginDto" - } - ] - }, - "scale": { - "type": "number", - "description": "Rendering scale between 0–2", - "example": 1.5, - "default": 1 - }, - "hideCookie": { - "type": "boolean", - "description": "Hide cookie popups", - "example": false, - "default": false - }, - "skipCaptcha": { - "type": "boolean", - "description": "Try to skip captcha", - "example": false, - "default": false - }, - "addTimestamp": { - "type": "boolean", - "description": "Add timestamp watermark", - "example": false, - "default": false - } - }, - "required": ["url"] - }, - "Url2PdfMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The target URL", - "example": "https://example.com" - }, - "device": { - "type": "string", - "description": "Device type used", - "example": "desktop" - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country used, if any" - }, - "format": { - "type": "string", - "description": "Paper format", - "example": "letter" - }, - "orientation": { - "type": "string", - "description": "Orientation", - "example": "landscape" - }, - "margin": { - "description": "Margins in mm", - "allOf": [ - { - "$ref": "#/components/schemas/MarginDto" - } - ] - }, - "scale": { - "type": "number", - "description": "Rendering scale", - "example": 1.5 - }, - "test": { - "description": "Test details", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "device", "format", "orientation", "scale", "test"] - }, - "Url2PdfResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the request", - "allOf": [ - { - "$ref": "#/components/schemas/Url2PdfMetaDto" - } - ] - }, - "data": { - "type": "string", - "description": "Generated PDF URL", - "example": "https://api-assets.example.com/tests/pdf/o5jiqf08bmp93jsll7vb24vs.pdf" - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "OpenPortDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The URL to be checked", - "example": "https://example.com" - }, - "topPorts": { - "type": "number", - "description": "Scan only the top N ports (optional)", - "example": 100, - "enum": [50, 100, 500, 1000, 5000] - }, - "portRanges": { - "type": "string", - "description": "Custom port ranges to scan, e.g., \"80,443,1000-1010\"", - "example": "80,443,1000-1010" - } - }, - "required": ["url"] - }, - "OpenPortMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The scanned URL", - "example": "https://example.com" - }, - "topPorts": { - "type": "number", - "description": "Top ports scanned (if any)", - "example": 100, - "enum": [50, 100, 500, 1000, 5000] - }, - "portRanges": { - "type": "string", - "description": "Custom port ranges scanned (if any)", - "example": "80,443,1000-1010" - }, - "test": { - "description": "Test details object", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "test"] - }, - "OpenPortResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the request", - "allOf": [ - { - "$ref": "#/components/schemas/OpenPortMetaDto" - } - ] - }, - "data": { - "description": "List of open ports found", - "type": "array", - "items": { - "type": "number" - } - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "TlsScanDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - } - }, - "required": ["url"] - }, - "TlsScanMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The target URL checked for TLS support", - "example": "example.com" - }, - "test": { - "description": "Test metadata object", - "example": { - "id": "40zt4but04y07ccn4pov5fiolzrxbxdg" - }, - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "test"] - }, - "TlsProtocolsDto": { - "type": "object", - "properties": { - "tls10": { - "type": "boolean", - "description": "Whether TLS 1.0 is supported", - "example": false - }, - "tls11": { - "type": "boolean", - "description": "Whether TLS 1.1 is supported", - "example": false - }, - "tls12": { - "type": "boolean", - "description": "Whether TLS 1.2 is supported", - "example": true - }, - "tls13": { - "type": "boolean", - "description": "Whether TLS 1.3 is supported", - "example": true - } - }, - "required": ["tls10", "tls11", "tls12", "tls13"] - }, - "TlsCertificateIssuerDto": { - "type": "object", - "properties": { - "country": { - "type": "string", - "description": "Issuer country", - "example": "US" - }, - "organization": { - "type": "string", - "description": "Issuer organization", - "example": "Cloudflare, Inc." - }, - "commonName": { - "type": "string", - "description": "Issuer common name", - "example": "Cloudflare Inc ECC CA-3" - } - }, - "required": ["country", "organization", "commonName"] - }, - "TlsCertificateDto": { - "type": "object", - "properties": { - "commonName": { - "type": "string", - "description": "Common name (CN) on the certificate", - "example": "sni.cloudflaressl.com" - }, - "subjectAltName": { - "type": "string", - "description": "Subject Alternative Names (SAN)", - "example": "DNS:*.example.com, DNS:sni.cloudflaressl.com, DNS:example.com" - }, - "issuer": { - "description": "Issuer details", - "allOf": [ - { - "$ref": "#/components/schemas/TlsCertificateIssuerDto" - } - ] - }, - "expiry": { - "type": "string", - "description": "Certificate expiry date", - "example": "Jun 6 23:59:59 2023 GMT" - } - }, - "required": ["commonName", "subjectAltName", "issuer", "expiry"] - }, - "TlsScanDataDto": { - "type": "object", - "properties": { - "protocols": { - "description": "Protocols supported", - "allOf": [ - { - "$ref": "#/components/schemas/TlsProtocolsDto" - } - ] - }, - "certificate": { - "description": "Certificate details", - "allOf": [ - { - "$ref": "#/components/schemas/TlsCertificateDto" - } - ] - } - }, - "required": ["protocols", "certificate"] - }, - "TlsScanResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the TLS scan request", - "example": { - "url": "example.com", - "test": { - "id": "40zt4but04y07ccn4pov5fiolzrxbxdg" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/TlsScanMetaDto" - } - ] - }, - "data": { - "description": "TLS scan result data", - "example": { - "protocols": { - "tls10": false, - "tls11": false, - "tls12": true, - "tls13": true - }, - "certificate": { - "commonName": "sni.cloudflaressl.com", - "subjectAltName": "DNS:*.example.com, DNS:sni.cloudflaressl.com, DNS:example.com", - "issuer": { - "country": "US", - "organization": "Cloudflare, Inc.", - "commonName": "Cloudflare Inc ECC CA-3" - }, - "expiry": "Jun 6 23:59:59 2023 GMT" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/TlsScanDataDto" - } - ] - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "LoadTimeDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "followRedirect": { - "type": "boolean", - "description": "Whether to follow redirects when checking site status", - "example": false, - "default": false - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - } - }, - "required": ["url"] - }, - "LoadTimeMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The tested URL", - "example": "https://example.com" - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country used for the test", - "example": "us" - }, - "followRedirect": { - "type": "boolean", - "description": "Indicates if redirects were followed during the test", - "example": true - }, - "redirectedURL": { - "type": "string", - "description": "Final URL after redirection (if any)", - "example": "https://example.com/" - }, - "test": { - "description": "Metadata about the test execution", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "redirectedURL", "test"] - }, - "TimingsDto": { - "type": "object", - "properties": { - "dns": { - "type": "number", - "description": "Time spent in DNS lookup (ms)", - "example": 21 - }, - "connect": { - "type": "number", - "description": "Time to establish TCP connection (ms)", - "example": 15 - }, - "tls": { - "type": "number", - "description": "Time to complete TLS handshake (ms)", - "example": 40 - }, - "send": { - "type": "number", - "description": "Time to send request (ms)", - "example": 1 - }, - "wait": { - "type": "number", - "description": "Server processing time (ms)", - "example": 457 - }, - "ttfb": { - "type": "number", - "description": "Time to First Byte - calculated as dns+connect+tls+send+wait (ms)", - "example": 534 - }, - "download": { - "type": "number", - "description": "Time to download response body (ms)", - "example": 4 - }, - "total": { - "type": "number", - "description": "Total load time (ms)", - "example": 538 - }, - "redirectDuration": { - "type": "number", - "description": "Time spent in redirects before reaching final URL (ms)", - "example": 0 - } - }, - "required": [ - "dns", - "connect", - "tls", - "send", - "wait", - "ttfb", - "download", - "total", - "redirectDuration" - ] - }, - "NetworkDto": { - "type": "object", - "properties": { - "protocol": { - "type": "string", - "description": "The actual HTTP protocol used (e.g. h2, h3, http/1.1, http/1.0)", - "example": "h2" - }, - "remoteIp": { - "type": "string", - "description": "Remote IP address of the server", - "example": "1.1.1.1" - }, - "bytesRead": { - "type": "number", - "description": "Total bytes read from the response", - "example": 15400 - } - }, - "required": ["protocol", "bytesRead"] - }, - "ProtocolSupportDto": { - "type": "object", - "properties": { - "http10": { - "type": "boolean", - "description": "Whether HTTP/1.0 is supported", - "example": false - }, - "http11": { - "type": "boolean", - "description": "Whether HTTP/1.1 is supported", - "example": true - }, - "http2": { - "type": "boolean", - "description": "Whether HTTP/2 is supported", - "example": true - }, - "http3": { - "type": "boolean", - "description": "Whether HTTP/3 is supported", - "example": false - }, - "http3SupportedVersion": { - "description": "HTTP/3 supported versions if available", - "example": ["h3-29", "h3"], - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["http10", "http11", "http2", "http3"] - }, - "LoadTimeDataDto": { - "type": "object", - "properties": { - "dns": { - "type": "number", - "description": "Time spent in DNS lookup (ms)", - "example": 10 - }, - "connect": { - "type": "number", - "description": "Time to establish TCP connection (ms)", - "example": 12 - }, - "tls": { - "type": "number", - "description": "Time to complete TLS handshake (ms)", - "example": 9 - }, - "send": { - "type": "number", - "description": "Time to send request (ms)", - "example": 19 - }, - "wait": { - "type": "number", - "description": "Time waiting for response (ms)", - "example": 86 - }, - "total": { - "type": "number", - "description": "Total load time (ms)", - "example": 88 - }, - "statusCode": { - "type": "number", - "description": "HTTP status code of the response", - "example": 404 - }, - "reasonPhrase": { - "type": "string", - "description": "HTTP reason phrase", - "example": "Not Found" - }, - "timings": { - "description": "Detailed timing breakdown", - "allOf": [ - { - "$ref": "#/components/schemas/TimingsDto" - } - ] - }, - "network": { - "description": "Network information", - "allOf": [ - { - "$ref": "#/components/schemas/NetworkDto" - } - ] - }, - "headers": { - "type": "object", - "description": "Response headers as key-value pairs", - "example": { - "server": "cloudflare", - "content-type": "text/html; charset=utf-8", - "cache-control": "no-cache" - } - }, - "protocolSupport": { - "description": "HTTP protocol support information", - "allOf": [ - { - "$ref": "#/components/schemas/ProtocolSupportDto" - } - ] - } - }, - "required": [ - "dns", - "connect", - "tls", - "send", - "wait", - "total", - "statusCode", - "reasonPhrase", - "timings", - "network", - "headers", - "protocolSupport" - ] - }, - "LoadTimeResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "message": { - "type": "string", - "description": "Overall message about site reachability", - "example": "Site is reachable." - }, - "meta": { - "description": "Metadata about the load time test", - "allOf": [ - { - "$ref": "#/components/schemas/LoadTimeMetaDto" - } - ] - }, - "data": { - "description": "Comprehensive site load time metrics", - "allOf": [ - { - "$ref": "#/components/schemas/LoadTimeDataDto" - } - ] - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "MixedContentDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "followRedirect": { - "type": "boolean", - "description": "Whether to follow redirects when checking site status", - "example": false, - "default": false - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - } - }, - "required": ["url"] - }, - "MixedContentMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The tested URL", - "example": "https://example.com" - }, - "proxyCountry": { - "type": "string", - "description": "Country used for proxy", - "example": "United States" - }, - "followRedirect": { - "type": "boolean", - "description": "Indicates if redirects should be followed", - "example": true - }, - "redirectedURL": { - "type": "string", - "description": "Final URL after redirection (if any)", - "example": "https://example.com/" - }, - "test": { - "description": "Metadata about the test execution", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "test"] - }, - "MixedContentDataDto": { - "type": "object", - "properties": { - "insecure": { - "description": "List of insecure (HTTP) resources found on the page", - "example": [ - "http://example.com/style.css", - "http://example.com/script.js" - ], - "type": "array", - "items": { - "type": "string" - } - }, - "secure": { - "description": "List of secure (HTTPS) resources found on the page", - "example": [ - "https://example.com/", - "https://fonts.googleapis.com/css?family=Open+Sans", - "data:image/svg+xml;base64,PHN2ZyB4bWxucz0i..." - ], - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["insecure", "secure"] - }, - "MixedContentResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "message": { - "type": "string", - "description": "Indicates whether mixed content found or not. It can either be \"Mixed content(s) found.\" or \"No mixed content found.\"", - "example": "Mixed content(s) found." - }, - "meta": { - "description": "Metadata about the mixed content test", - "allOf": [ - { - "$ref": "#/components/schemas/MixedContentMetaDto" - } - ] - }, - "data": { - "description": "Contains either an array of all resources (when no mixed content) or an object with insecure/secure arrays (when mixed content found)", - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - }, - "description": "Simple array of all resources when no mixed content found", - "example": [ - "https://example.com/", - "https://example.com/style.css", - "https://example.com/script.js" - ] - }, - { - "$ref": "#/components/schemas/MixedContentDataDto", - "description": "Object with insecure and secure arrays when mixed content found" - } - ] - } - }, - "required": [ - "timestamp", - "apiStatus", - "apiCode", - "message", - "meta", - "data" - ] - }, - "DnsSecDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - } - }, - "required": ["url"] - }, - "DnsSecMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The tested domain name", - "example": "example.com" - }, - "test": { - "description": "Metadata about the test execution", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "test"] - }, - "DnsSecDataDto": { - "type": "object", - "properties": { - "isEnabled": { - "type": "boolean", - "description": "Indicates if DNSSEC is enabled for the domain", - "example": true - }, - "dnskey": { - "description": "List of DNSKEY records if DNSSEC is enabled", - "example": [ - "DNSKEY 256 3 13 oJMRESz5E4gYzS/q6XDrvU1qMPYIjCWzJaOau8XNEZeqCYKD5ar0IRd8 KqXXFJkqmVfRvMGPmM1x8fGAa2XhSA==" - ], - "type": "array", - "items": { - "type": "string" - } - }, - "rrsig": { - "description": "List of RRSIG records if DNSSEC is enabled", - "example": [ - "RRSIG DNSKEY 13 2 3600 20251124121323 20250924121323 2371 geekflare.com. LUeqKWfw4GcaqSaCbFT7ik6mTgFdWsRdVzn1hHGSwMGZ4HuwlVFB3e1K 9Os+4DnxyYNkfWkBHJcBfFN7e4snHg==" - ], - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["isEnabled"] - }, - "DnsSecResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the DNSSEC test", - "allOf": [ - { - "$ref": "#/components/schemas/DnsSecMetaDto" - } - ] - }, - "data": { - "description": "DNSSEC test result data", - "allOf": [ - { - "$ref": "#/components/schemas/DnsSecDataDto" - } - ] - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "MtrDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "followRedirect": { - "type": "boolean", - "description": "Whether to follow redirects when checking site status", - "example": false, - "default": false - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - } - }, - "required": ["url"] - }, - "MtrMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The tested URL or IP address", - "example": "example.com" - }, - "proxyCountry": { - "type": "string", - "description": "Country used for proxy", - "example": "United States" - }, - "followRedirect": { - "type": "boolean", - "description": "Indicates if redirects should be followed", - "example": true - }, - "redirectedURL": { - "type": "string", - "description": "Final URL after redirection (if any)", - "example": "https://example.com/" - }, - "test": { - "description": "Metadata about the test execution", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "redirectedURL", "test"] - }, - "MtrDataDto": { - "type": "object", - "properties": { - "hop": { - "type": "number", - "description": "Hop number in the traceroute path", - "example": 1 - }, - "host": { - "type": "string", - "description": "Host IP or domain name at this hop", - "example": "240.192.18.19" - }, - "asn": { - "type": "string", - "description": "Autonomous System Number (ASN) for the host", - "example": "AS???" - }, - "loss": { - "type": "number", - "description": "Packet loss percentage at this hop", - "example": 0 - }, - "sent": { - "type": "number", - "description": "Number of packets sent to this hop", - "example": 2 - }, - "last": { - "type": "number", - "description": "Last recorded round-trip time (RTT) in milliseconds", - "example": 0.28 - }, - "avg": { - "type": "number", - "description": "Average RTT across packets", - "example": 0.29 - }, - "best": { - "type": "number", - "description": "Best (lowest) RTT observed", - "example": 0.28 - }, - "worst": { - "type": "number", - "description": "Worst (highest) RTT observed", - "example": 0.3 - }, - "stdDev": { - "type": "number", - "description": "Standard deviation of RTT measurements", - "example": 0.01 - } - }, - "required": [ - "hop", - "host", - "asn", - "loss", - "sent", - "last", - "avg", - "best", - "worst", - "stdDev" - ] - }, - "MtrResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the MTR test execution", - "allOf": [ - { - "$ref": "#/components/schemas/MtrMetaDto" - } - ] - }, - "data": { - "description": "Array of hop details observed in the MTR trace route", - "example": [ - { - "hop": 1, - "host": "240.192.18.19", - "asn": "AS???", - "loss": 0, - "sent": 2, - "last": 0.28, - "avg": 0.29, - "best": 0.28, - "worst": 0.3, - "stdDev": 0.01 - }, - { - "hop": 2, - "host": "240.0.60.49", - "asn": "AS???", - "loss": 0, - "sent": 2, - "last": 0.28, - "avg": 0.29, - "best": 0.28, - "worst": 0.29, - "stdDev": 0.01 - } - ], - "type": "array", - "items": { - "$ref": "#/components/schemas/MtrDataDto" - } - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "PingDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - } - }, - "required": ["url"] - }, - "PingMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The tested URL or IP address", - "example": "example.com" - }, - "test": { - "description": "Metadata about the test execution", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "test"] - }, - "PingDataDto": { - "type": "object", - "properties": { - "requests": { - "type": "number", - "description": "Number of ping requests sent", - "example": 4 - }, - "loss": { - "type": "number", - "description": "Packet loss percentage", - "example": 0 - }, - "latency": { - "type": "number", - "description": "Average latency in milliseconds", - "example": 32.5 - }, - "min": { - "type": "number", - "description": "Minimum round-trip time (RTT) in milliseconds", - "example": 30 - }, - "max": { - "type": "number", - "description": "Maximum round-trip time (RTT) in milliseconds", - "example": 35 - }, - "avg": { - "type": "number", - "description": "Average round-trip time (RTT) in milliseconds", - "example": 32.5 - }, - "stdDev": { - "type": "number", - "description": "Standard deviation of RTT in milliseconds", - "example": 1.5 - }, - "ip": { - "type": "string", - "description": "Resolved IP address of the tested domain", - "example": "142.250.183.206" - } - }, - "required": [ - "requests", - "loss", - "latency", - "min", - "max", - "avg", - "stdDev", - "ip" - ] - }, - "PingResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the Ping test execution", - "allOf": [ - { - "$ref": "#/components/schemas/PingMetaDto" - } - ] - }, - "data": { - "description": "Ping result statistics", - "example": { - "requests": 4, - "loss": 0, - "latency": 32.5, - "min": 30, - "max": 35, - "avg": 32.5, - "stdDev": 1.5, - "ip": "142.250.183.206" - }, - "allOf": [ - { - "$ref": "#/components/schemas/PingDataDto" - } - ] - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "LighthouseDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "device": { - "type": "string", - "description": "Device type to emulate. Defaults to desktop.", - "example": "desktop", - "enum": ["desktop", "mobile"], - "default": "desktop" - }, - "followRedirect": { - "type": "boolean", - "description": "Whether to follow redirects when checking site status", - "example": false, - "default": false - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country code to route the request", - "example": "us" - }, - "parameters": { - "description": "Extra Lighthouse CLI parameters", - "example": ["--only-categories=seo"], - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["url"] - }, - "LighthouseMetaDto": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "Target URL", - "example": "https://example.com" - }, - "device": { - "type": "string", - "description": "Device type used", - "enum": ["desktop", "mobile"] - }, - "followRedirect": { - "type": "boolean", - "description": "Whether redirects were followed" - }, - "redirectedURL": { - "type": "string", - "description": "Final URL after redirection (if any)", - "example": "https://example.com/" - }, - "proxyCountry": { - "type": "string", - "description": "Proxy country used, if any" - }, - "test": { - "description": "Test details object", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": ["url", "device", "followRedirect", "redirectedURL", "test"] - }, - "LighthouseResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "description": "Metadata about the request", - "allOf": [ - { - "$ref": "#/components/schemas/LighthouseMetaDto" - } - ] - }, - "data": { - "type": "string", - "description": "URL to the Lighthouse report", - "example": "https://example.com/report.html" - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "SearchMetaDto": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "Original query", - "example": "best running shoes" - }, - "count": { - "type": "number", - "description": "Number of results returned", - "example": 10 - }, - "source": { - "description": "Search source used", - "example": "web", - "type": "array", - "items": { - "type": "string" - } - }, - "location": { - "type": "string", - "description": "Country used for ranking", - "example": "us" - }, - "time": { - "type": "string", - "description": "Time filter applied", - "example": "d" - }, - "scrape": { - "type": "boolean", - "description": "Whether URL scraping was enabled", - "example": false - }, - "scrapeLimit": { - "type": "number", - "description": "Number of URLs scraped", - "example": 3 - }, - "test": { - "description": "Test metadata", - "allOf": [ - { - "$ref": "#/components/schemas/TestMetaDto" - } - ] - } - }, - "required": [ - "query", - "count", - "source", - "location", - "time", - "scrape", - "scrapeLimit", - "test" - ] - }, - "SearchResultItemDto": { - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "Result title", - "example": "Best Running Shoes of 2025" - }, - "url": { - "type": "string", - "description": "Canonical URL", - "example": "https://example.com/running-shoes" - }, - "snippet": { - "type": "string", - "description": "Clean snippet (ads/HTML removed)", - "example": "We tested over 100 pairs to find the best running shoes..." - }, - "date": { - "type": "string", - "description": "Published date (if available)", - "example": "Dec 18, 2025" - }, - "position": { - "type": "number", - "description": "Rank position", - "example": 1 - }, - "content": { - "type": "object", - "description": "Scraped cleaned HTML content from the result URL", - "example": "Full article cleaned for LLM consumption..." - } - }, - "required": ["title", "url", "snippet", "position"] - }, - "SearchResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "$ref": "#/components/schemas/SearchMetaDto" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SearchResultItemDto" - } - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "ImageSearchResultItemDto": { - "type": "object", - "properties": { - "title": { - "type": "string", - "example": "Nike Alphafly 3" - }, - "imageUrl": { - "type": "string", - "example": "https://example.com/img.jpg" - }, - "sourceUrl": { - "type": "string", - "example": "https://example.com/page" - }, - "width": { - "type": "number", - "example": 1024 - }, - "height": { - "type": "number", - "example": 768 - } - }, - "required": ["title", "imageUrl", "sourceUrl", "width", "height"] - }, - "ImageSearchResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "$ref": "#/components/schemas/SearchMetaDto" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ImageSearchResultItemDto" - } - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "SearchMarkdownResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "$ref": "#/components/schemas/SearchMetaDto" - }, - "data": { - "type": "object", - "example": "1. [Title](https://example.com)\n - snippet" - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "SearchHtmlResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "meta": { - "$ref": "#/components/schemas/SearchMetaDto" - }, - "data": { - "type": "object", - "example": "" - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "meta", "data"] - }, - "SearchRequestDto": { - "type": "object", - "properties": { - "query": { - "type": "string", - "description": "Search query", - "example": "best running shoes", - "maxLength": 2048 - }, - "limit": { - "type": "number", - "description": "Number of results", - "example": 10, - "default": 10, - "minimum": 1, - "maximum": 100 - }, - "time": { - "type": "string", - "description": "Time filter (h, d, w, m, y or h2, d7, etc.)", - "example": "d", - "default": "any" - }, - "location": { - "type": "string", - "description": "Country code (ISO alpha-2)", - "example": "us", - "default": "us" - }, - "source": { - "type": "string", - "description": "Search source", - "enum": ["web", "news", "images"], - "example": "web", - "default": "web" - }, - "category": { - "type": "string", - "description": "Category filter", - "enum": ["general", "code", "pdf", "research", "linkedin", "wiki"], - "example": "code", - "default": "general" - }, - "includeDomains": { - "description": "Include only these domains", - "example": ["reddit.com", "stackoverflow.com"], - "type": "array", - "items": { - "type": "string" - } - }, - "excludeDomains": { - "description": "Exclude these domains", - "example": ["pinterest.com"], - "type": "array", - "items": { - "type": "string" - } - }, - "format": { - "type": "string", - "description": "Output format", - "enum": ["json", "markdown", "html"], - "default": "json" - }, - "scrape": { - "type": "boolean", - "description": "scrape and extract content from SERP result URLs", - "example": false, - "default": false - }, - "scrapeLimit": { - "type": "number", - "description": "Number of URLs to scrape (requires scrape: true)", - "example": 3, - "default": 3, - "minimum": 1, - "maximum": 10 - } - }, - "required": ["query"] - }, - "HealthResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "message": { - "type": "string", - "description": "Metadata about the request" - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "message"] - }, - "ServiceStatus": { - "type": "object", - "properties": { - "name": { - "type": "string", - "example": "r2", - "description": "Name of the service" - }, - "status": { - "type": "string", - "example": "healthy", - "description": "Health status of the service (e.g., healthy, degraded, down)" - }, - "message": { - "type": "string", - "example": "All systems operational", - "description": "Additional info or error message if any" - } - }, - "required": ["name", "status", "message"] - }, - "ServiceHealthResponseDto": { - "type": "object", - "properties": { - "timestamp": { - "type": "number", - "description": "Timestamp of the request in milliseconds", - "example": 1777874383873 - }, - "apiStatus": { - "type": "string", - "description": "API status message", - "example": "success", - "enum": ["success", "failure"] - }, - "apiCode": { - "type": "number", - "description": "API status code", - "example": 200 - }, - "message": { - "type": "string", - "description": "Top-level message summarizing the overall health check", - "example": "Service health check completed" - }, - "services": { - "description": "Status of individual internal services", - "type": "array", - "items": { - "$ref": "#/components/schemas/ServiceStatus" - } - } - }, - "required": ["timestamp", "apiStatus", "apiCode", "message", "services"] - } - } - } -} diff --git a/pyproject.toml b/pyproject.toml index f63d84e..c718ff7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,17 +4,17 @@ build-backend = "setuptools.build_meta" [project] name = "geekflare-api" -version = "0.1.1" +version = "0.1.2" description = "Official Python SDK for Geekflare API" readme = "README.md" license = { text = "MIT" } authors = [{ name = "Geekflare", email = "support@geekflare.com" }] keywords = ["geekflare", "api", "sdk", "scraping", "screenshot", "dns", "search"] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ - "urllib3>=1.25.3", + "urllib3>=2.1.0,<3.0.0", "python-dateutil>=2.8.2", - "pydantic>=2.0.0", + "pydantic>=2.11", "typing-extensions>=4.7.1", ] diff --git a/setup.py b/setup.py index 1098068..2662172 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "geekflare-api" -VERSION = "0.1.0" +VERSION = "0.1.2" PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ "urllib3 >= 2.1.0, < 3.0.0", diff --git a/test/test_grounded_answer_data_dto.py b/test/test_grounded_answer_data_dto.py new file mode 100644 index 0000000..3355601 --- /dev/null +++ b/test/test_grounded_answer_data_dto.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.grounded_answer_data_dto import GroundedAnswerDataDto + +class TestGroundedAnswerDataDto(unittest.TestCase): + """GroundedAnswerDataDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroundedAnswerDataDto: + """Test GroundedAnswerDataDto + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GroundedAnswerDataDto` + """ + model = GroundedAnswerDataDto() + if include_optional: + return GroundedAnswerDataDto( + answer = '', + sources = [ + geekflare_api.models.grounded_source_dto.GroundedSourceDto( + title = 'web', + url = 'https://example.com', + position = 1, ) + ] + ) + else: + return GroundedAnswerDataDto( + answer = '', + sources = [ + geekflare_api.models.grounded_source_dto.GroundedSourceDto( + title = 'web', + url = 'https://example.com', + position = 1, ) + ], + ) + """ + + def testGroundedAnswerDataDto(self): + """Test GroundedAnswerDataDto""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_grounded_answer_response_dto.py b/test/test_grounded_answer_response_dto.py new file mode 100644 index 0000000..7cf53e4 --- /dev/null +++ b/test/test_grounded_answer_response_dto.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.grounded_answer_response_dto import GroundedAnswerResponseDto + +class TestGroundedAnswerResponseDto(unittest.TestCase): + """GroundedAnswerResponseDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroundedAnswerResponseDto: + """Test GroundedAnswerResponseDto + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GroundedAnswerResponseDto` + """ + model = GroundedAnswerResponseDto() + if include_optional: + return GroundedAnswerResponseDto( + timestamp = 1783063255117, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = geekflare_api.models.grounded_answer_data_dto.GroundedAnswerDataDto( + answer = '', + sources = [ + geekflare_api.models.grounded_source_dto.GroundedSourceDto( + title = 'web', + url = 'https://example.com', + position = 1, ) + ], ) + ) + else: + return GroundedAnswerResponseDto( + timestamp = 1783063255117, + api_status = 'success', + api_code = 200, + meta = geekflare_api.models.search_meta_dto.SearchMetaDto( + query = 'best running shoes', + count = 10, + source = web, + location = 'us', + time = 'd', + scrape = False, + scrape_limit = 3, + test = null, ), + data = geekflare_api.models.grounded_answer_data_dto.GroundedAnswerDataDto( + answer = '', + sources = [ + geekflare_api.models.grounded_source_dto.GroundedSourceDto( + title = 'web', + url = 'https://example.com', + position = 1, ) + ], ), + ) + """ + + def testGroundedAnswerResponseDto(self): + """Test GroundedAnswerResponseDto""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_grounded_source_dto.py b/test/test_grounded_source_dto.py new file mode 100644 index 0000000..87b92ec --- /dev/null +++ b/test/test_grounded_source_dto.py @@ -0,0 +1,56 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.grounded_source_dto import GroundedSourceDto + +class TestGroundedSourceDto(unittest.TestCase): + """GroundedSourceDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GroundedSourceDto: + """Test GroundedSourceDto + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GroundedSourceDto` + """ + model = GroundedSourceDto() + if include_optional: + return GroundedSourceDto( + title = 'web', + url = 'https://example.com', + position = 1 + ) + else: + return GroundedSourceDto( + title = 'web', + url = 'https://example.com', + position = 1, + ) + """ + + def testGroundedSourceDto(self): + """Test GroundedSourceDto""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_screenshot_inline_dto.py b/test/test_screenshot_inline_dto.py new file mode 100644 index 0000000..433ef73 --- /dev/null +++ b/test/test_screenshot_inline_dto.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.screenshot_inline_dto import ScreenshotInlineDto + +class TestScreenshotInlineDto(unittest.TestCase): + """ScreenshotInlineDto unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ScreenshotInlineDto: + """Test ScreenshotInlineDto + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ScreenshotInlineDto` + """ + model = ScreenshotInlineDto() + if include_optional: + return ScreenshotInlineDto( + var_base64 = 'iVBORw0KGgoAAAANSUhEUgAA...', + data_uri = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...' + ) + else: + return ScreenshotInlineDto( + var_base64 = 'iVBORw0KGgoAAAANSUhEUgAA...', + data_uri = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...', + ) + """ + + def testScreenshotInlineDto(self): + """Test ScreenshotInlineDto""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_web_scrape_response_dto_data.py b/test/test_web_scrape_response_dto_data.py new file mode 100644 index 0000000..2f71481 --- /dev/null +++ b/test/test_web_scrape_response_dto_data.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +""" + Geekflare API + + Official OpenAPI specification for all Geekflare API endpoints. + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from geekflare_api.models.web_scrape_response_dto_data import WebScrapeResponseDtoData + +class TestWebScrapeResponseDtoData(unittest.TestCase): + """WebScrapeResponseDtoData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> WebScrapeResponseDtoData: + """Test WebScrapeResponseDtoData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `WebScrapeResponseDtoData` + """ + model = WebScrapeResponseDtoData() + if include_optional: + return WebScrapeResponseDtoData( + ) + else: + return WebScrapeResponseDtoData( + ) + """ + + def testWebScrapeResponseDtoData(self): + """Test WebScrapeResponseDtoData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main()