├── C# └── C#QuickStart.cs ├── Java └── JavaQuickStart.java ├── Python └── PythonQuickStart.py └── README.md /C#/C#QuickStart.cs: -------------------------------------------------------------------------------- 1 | var client = new HttpClient(); 2 | var request = new HttpRequestMessage 3 | { 4 | Method = HttpMethod.Post, 5 | RequestUri = new Uri("https://document-scanner.p.rapidapi.com/DetectDocument"), 6 | Headers = 7 | { 8 | { "x-rapidapi-key", "API KEY" }, 9 | { "x-rapidapi-host", "document-scanner.p.rapidapi.com" }, 10 | }, 11 | }; 12 | using (var response = await client.SendAsync(request)) 13 | { 14 | response.EnsureSuccessStatusCode(); 15 | var body = await response.Content.ReadAsStringAsync(); 16 | Console.WriteLine(body); 17 | } 18 | -------------------------------------------------------------------------------- /Java/JavaQuickStart.java: -------------------------------------------------------------------------------- 1 | HttpRequest request = HttpRequest.newBuilder() 2 | .uri(URI.create("https://document-scanner.p.rapidapi.com/DetectDocument")) 3 | .header("x-rapidapi-key", "API KEY") 4 | .header("x-rapidapi-host", "document-scanner.p.rapidapi.com") 5 | .method("POST", HttpRequest.BodyPublishers.noBody()) 6 | .build(); 7 | HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); 8 | System.out.println(response.body()); 9 | -------------------------------------------------------------------------------- /Python/PythonQuickStart.py: -------------------------------------------------------------------------------- 1 | import requests (in Rapidapi.com) 2 | 3 | api_url = 'https://document-detection.p.rapidapi.com/DetectDocument' 4 | api_key = 'Your API Key' 5 | 6 | image_path = 'Image directory path' 7 | image_name = 'Image name' 8 | 9 | files = {'image': (image_name, open(image_path + image_name, 'rb'), 'multipart/form-data')} 10 | header = { 11 | "x-rapidapi-host": "document-detection.p.rapidapi.com", 12 | "x-rapidapi-key": api_key 13 | } 14 | response = requests.post(api_url, files=files, headers=header) 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Document Scanner 2 | PresentID Document scanner API localizes document images with various distortion types from a single input image. 3 | 4 | 5 | 6 | **Input:** 7 | - Image file 8 | - Image URL link 9 | - Base64 image 10 | 11 | **Output:** 12 | - Base64 image 13 | - Status message 14 | 15 | **Features:** 16 | - Less than 1.5 seconds on CPU core i7. 17 | - Perfect detection on a salient document in the image. 18 | - Support IOS, Android, Windows and Mac devices. 19 | - Easy integration with your app. 20 | 21 | **Use Cases:** 22 | - To create PDF files and notes and books. 23 | - Ease of separating text in images. 24 | 25 | **Rules & Restrictions:** 26 | - Send data via Base64 or an image URL or an image file. 27 | - Image size should not exceed 8 MB. 28 | - Also, the images should not be larger than 5000 pixels and smaller than 50 pixels. 29 | 30 | ## Freetry in RapidAPI 31 | https://rapidapi.com/PresentID/api/document-scanner 32 | --------------------------------------------------------------------------------