Photo to Text Conversion API

Convert photos to text accurately and fast with our Photo to Text Conversion API.
Use this API from your AI agent via MCP
Works with OpenClaw, Claude Code/Desktop, Cursor, Windsurf, Cline and any MCP-compatible AI client.
Docs & setup
Create a skill by wrapping this MCP: https://mcp.zylalabs.com/mcp?apikey=YOUR_ZYLA_API_KEY

The Photo to Text Conversion API allows you to convert images containing text into structured data that can be digitally processed and analyzed. Its main function is to automatically identify words, lines, and blocks of text within an image, providing not only the textual content, but also information about the exact location of each element within the image using bounding box coordinates. This facilitates tasks such as extracting data from documents, passports, invoices, forms, or any image containing text.

Each word recognized by the API includes a confidence value that indicates the probability that the recognition is correct, allowing you to filter or review the results based on their accuracy. The API organizes information hierarchically: texts are grouped into blocks, blocks contain paragraphs, and paragraphs contain lines and individual words. This structure makes it easy to analyze complex documents and maintain the context of the extracted text.

In addition to textual transcription, the API can capture formatting information such as punctuation, capitalization, and word separations, and can provide metadata useful for document processing, search, and automated analysis applications. The output includes normalized coordinates (values between 0 and 1) representing the position of the text in the image, enabling visual reconstruction of the content or integration with marking and annotation systems.

The API is particularly useful in scenarios where physical or scanned documents need to be digitized, data entry processes need to be automated, or document reading systems need to be built for auditing, identity control, or document management. Its modular and detailed approach allows for both rapid text extraction and deeper analysis, including the validation of sensitive data such as names, identification numbers, and dates, as seen in an example of Haitian passport recognition, where names, dates, and codes are extracted in a hierarchical and detailed manner.

In summary, this API combines optical character recognition, precision in the location of each word, and hierarchical structure to convert images into reliable and actionable textual data.

API Documentation

Endpoints


Converts images into text, detects words, lines, and blocks, providing coordinates, confidence, and hierarchical structure of visual content.



                                                                            
POST https://www.zylalabs.com/api/11262/photo+to+text+conversion+api/21265/text+extraction
                                                                            
                                                                        

Text extraction - Endpoint Features

Object Description
image_url [Required] Enter a image URL
Test Endpoint

API EXAMPLE RESPONSE

       
                                                                                                        
                                                                                                                                                                                                                                                                                                                                        {"status":true,"text":": AYITI: am PASPO re Py asia Etat oa ta   PASSEPORT Aalto! Type ne f : BEB aon HTL 920000018   CHERUBIN  Nea! Priam Kote 1 it! Lieu ce reetcceras NIRKA PORT~AU-PRINCE Moun bs reve‘ Rabongate  HAITIENNE  Oat H M41! Date ds calecance  6 MAI 1962  Fi catyer green! Seer  FEMININ   Gat peeps » set Dots Senissinn SIVAT) MET PASPO 4   17 DECEMBRE 1992 MSIGNGTURE Ou TITULAIRE   amt parno 3 tn Dots Pespirotca   16 DECEMBRE 1997      920000018   SPECIMEN","boxCoordinates":[0.1197110423116615,0.05071315372424723,0.8421052631578947,0.8557844690966719],"blocks":[{"paragraphs":[{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]}],"boxCoordinates":[0,0,0,0]}],"boxCoordinates":[0,0,0,0]},{"paragraphs":[{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]}],"boxCoordinates":[0,0,0,0]},{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]},{"text":": AYITI: am","words":[{"text":":","boxCoordinates":[0.20227038183694532,0.08240887480190175,0.0030959752321981426,0.003169572107765452],"confidence":0.0},{"text":"AYITI:","boxCoordinates":[0.6945304437564499,0.05071315372424723,0.0608875128998968,0.06497622820919176],"confidence":0.0},{"text":"am","boxCoordinates":[0.762641898864809,0.06656101426307448,0.048503611971104234,0.07131537242472266],"confidence":46.0}],"boxCoordinates":[0.20227038183694532,0.05071315372424723,0.608875128998968,0.08716323296354993]},{"text":"PASPO re Py asia Etat","words":[{"text":"PASPO","boxCoordinates":[0.15067079463364294,0.08557844690966719,0.06398348813209494,0.05705229793977813],"confidence":87.0},{"text":"re","boxCoordinates":[0.5479876160990712,0.11727416798732171,0.022703818369453045,0.017432646592709985],"confidence":21.0},{"text":"Py","boxCoordinates":[0.5851393188854489,0.12519809825673534,0.009287925696594427,0.030110935023771792],"confidence":46.0},{"text":"asia","boxCoordinates":[0.608875128998968,0.10935023771790808,0.04953560371517028,0.05229793977812995],"confidence":32.0},{"text":"Etat","boxCoordinates":[0.6656346749226006,0.10935023771790808,0.034055727554179564,0.039619651347068144],"confidence":13.0}],"boxCoordinates":[0.15067079463364294,0.08557844690966719,0.5490196078431373,0.07606973058637084]},{"text":"oa ta","words":[{"text":"oa","boxCoordinates":[0.5954592363261094,0.11410459587955626,0.02476780185758514,0.06497622820919176],"confidence":25.0},{"text":"ta","boxCoordinates":[0.6336429308565531,0.14580031695721077,0.02476780185758514,0.01901743264659271],"confidence":29.0}],"boxCoordinates":[0.5954592363261094,0.11410459587955626,0.0629514963880289,0.06497622820919176]}],"boxCoordinates":[0.15067079463364294,0.05071315372424723,0.6604747162022704,0.12836767036450078]}],"boxCoordinates":[0.15067079463364294,0.05071315372424723,0.6604747162022704,0.12836767036450078]},{"paragraphs":[{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]}],"boxCoordinates":[0,0,0,0]},{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]},{"text":"PASSEPORT Aalto! Type ne f :","words":[{"text":"PASSEPORT","boxCoordinates":[0.1197110423116615,0.12678288431061807,0.11661506707946337,0.05229793977812995],"confidence":91.0},{"text":"Aalto!","boxCoordinates":[0.3632610939112487,0.14580031695721077,0.04231166150670795,0.01901743264659271],"confidence":0.0},{"text":"Type","boxCoordinates":[0.41382868937048506,0.14580031695721077,0.03199174406604747,0.022187004754358162],"confidence":88.0},{"text":"ne","boxCoordinates":[0.5108359133126935,0.11568938193343899,0.029927760577915376,0.0491283676703645],"confidence":47.0},{"text":"f","boxCoordinates":[0.5500515995872033,0.14580031695721077,0.0030959752321981426,0.01901743264659271],"confidence":18.0},{"text":":","boxCoordinates":[0.8224974200206399,0.1648177496038035,0.0030959752321981426,0.003169572107765452],"confidence":10.0}],"boxCoordinates":[0.1197110423116615,0.11568938193343899,0.7058823529411765,0.06339144215530904]},{"text":"BEB aon HTL 920000018","words":[{"text":"BEB","boxCoordinates":[0.3622291021671827,0.1901743264659271,0.04231166150670795,0.05388272583201268],"confidence":54.0},{"text":"aon","boxCoordinates":[0.4169246646026832,0.1838351822503962,0.02786377708978328,0.08399366085578447],"confidence":27.0},{"text":"HTL","boxCoordinates":[0.5696594427244582,0.19334389857369255,0.04437564499484004,0.03169572107765452],"confidence":40.0},{"text":"920000018","boxCoordinates":[0.7275541795665634,0.19175911251980982,0.14138286893704852,0.03645007923930269],"confidence":95.0}],"boxCoordinates":[0.3622291021671827,0.1838351822503962,0.5067079463364293,0.08399366085578447]}],"boxCoordinates":[0.1197110423116615,0.11568938193343899,0.7492260061919505,0.15213946117274169]}],"boxCoordinates":[0.1197110423116615,0.11568938193343899,0.7492260061919505,0.15213946117274169]},{"paragraphs":[{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]}],"boxCoordinates":[0,0,0,0]},{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]},{"text":"CHERUBIN","words":[{"text":"CHERUBIN","boxCoordinates":[0.3622291021671827,0.24722662440570523,0.1259029927760578,0.03486529318541997],"confidence":90.0}],"boxCoordinates":[0.3622291021671827,0.24722662440570523,0.1259029927760578,0.03486529318541997]}],"boxCoordinates":[0.3622291021671827,0.24722662440570523,0.1259029927760578,0.03486529318541997]},{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]},{"text":"Nea! Priam Kote 1 it! Lieu ce reetcceras","words":[{"text":"Nea!","boxCoordinates":[0.36119711042311664,0.29635499207606975,0.03508771929824561,0.022187004754358162],"confidence":32.0},{"text":"Priam","boxCoordinates":[0.40350877192982454,0.29160063391442154,0.048503611971104234,0.02377179080824089],"confidence":28.0},{"text":"Kote","boxCoordinates":[0.7481940144478845,0.29952456418383516,0.043343653250773995,0.01901743264659271],"confidence":60.0},{"text":"1","boxCoordinates":[0.7884416924664602,0.2884310618066561,0.006191950464396285,0.04595879556259905],"confidence":39.0},{"text":"it!","boxCoordinates":[0.803921568627451,0.29952456418383516,0.02063983488132095,0.01901743264659271],"confidence":0.0},{"text":"Lieu","boxCoordinates":[0.8297213622291022,0.3011093502377179,0.026831785345717233,0.017432646592709985],"confidence":0.0},{"text":"ce","boxCoordinates":[0.8637770897832817,0.3058637083993661,0.015479876160990712,0.012678288431061807],"confidence":48.0},{"text":"reetcceras","boxCoordinates":[0.8885448916408669,0.3074484944532488,0.06604747162022703,0.011093502377179081],"confidence":0.0}],"boxCoordinates":[0.36119711042311664,0.2884310618066561,0.5933952528379773,0.04595879556259905]},{"text":"NIRKA PORT~AU-PRINCE","words":[{"text":"NIRKA","boxCoordinates":[0.36119711042311664,0.3248811410459588,0.07946336429308566,0.03169572107765452],"confidence":91.0},{"text":"PORT~AU-PRINCE","boxCoordinates":[0.7430340557275542,0.329635499207607,0.21878224974200206,0.03486529318541997],"confidence":0.0}],"boxCoordinates":[0.36119711042311664,0.3248811410459588,0.6006191950464397,0.039619651347068144]},{"text":"Moun bs reve‘ Rabongate","words":[{"text":"Moun","boxCoordinates":[0.36119711042311664,0.37083993660855785,0.038183694530443756,0.020602218700475437],"confidence":68.0},{"text":"bs","boxCoordinates":[0.4086687306501548,0.37400950871632327,0.010319917440660475,0.01584786053882726],"confidence":53.0},{"text":"reve‘","boxCoordinates":[0.4262125902992776,0.36450079239302696,0.038183694530443756,0.04120443740095087],"confidence":17.0},{"text":"Rabongate","boxCoordinates":[0.46852425180598556,0.36450079239302696,0.07223942208462332,0.04120443740095087],"confidence":0.0}],"boxCoordinates":[0.36119711042311664,0.36450079239302696,0.17956656346749225,0.04120443740095087]}],"boxCoordinates":[0.36119711042311664,0.2884310618066561,0.6006191950464397,0.11727416798732171]},{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]},{"text":"HAITIENNE","words":[{"text":"HAITIENNE","boxCoordinates":[0.36119711042311664,0.40253565768621236,0.14138286893704852,0.03486529318541997],"confidence":91.0}],"boxCoordinates":[0.36119711042311664,0.40253565768621236,0.14138286893704852,0.03486529318541997]}],"boxCoordinates":[0.36119711042311664,0.40253565768621236,0.14138286893704852,0.03486529318541997]},{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]},{"text":"Oat H M41! Date ds calecance","words":[{"text":"Oat","boxCoordinates":[0.36119711042311664,0.4469096671949287,0.023735810113519093,0.017432646592709985],"confidence":72.0},{"text":"H","boxCoordinates":[0.3931888544891641,0.4500792393026941,0.008255933952528379,0.014263074484944533],"confidence":0.0},{"text":"M41!","boxCoordinates":[0.40970072239422084,0.44532488114104596,0.02476780185758514,0.020602218700475437],"confidence":0.0},{"text":"Date","boxCoordinates":[0.43962848297213625,0.4500792393026941,0.033023735810113516,0.017432646592709985],"confidence":70.0},{"text":"ds","boxCoordinates":[0.478844169246646,0.44849445324881143,0.015479876160990712,0.020602218700475437],"confidence":68.0},{"text":"calecance","boxCoordinates":[0.5025799793601651,0.4532488114104596,0.06501547987616099,0.01584786053882726],"confidence":0.0}],"boxCoordinates":[0.36119711042311664,0.44532488114104596,0.20639834881320948,0.02377179080824089]}],"boxCoordinates":[0.36119711042311664,0.44532488114104596,0.20639834881320948,0.02377179080824089]},{"lines":[{"text":"","words":[],"boxCoordinates":[0,0,0,0]},{"text":"6 MAI 1962","words":[{"text":"6","boxCoordinates":[0.36119711042311664,0.48019017432646594,0.015479876160990712,0.03328050713153724],"confidence":94.0},{"text":"MAI","boxCoordinates":[0.3931888544891641,0.48019017432646594,0.04540763673890609,0.03328050713153724],"confidence":94.0},{"text":"1962","boxCoordinates":[0.45717234262125905,0.4786053882725832,0.06191950464396285,0.03645007923930269],"confidence":95.0}],"boxCoordinates":[0.36119711042311664,0.4786053882725832,0.15789473684210525,0.03645007923930269]}],"boxCoordinates":[0.36119711042311664,0.4786053882725832,0.15789473684210525,0.03645007923930269]}]}],"_note":"Response truncated for documentation purposes"}
                                                                                                                                                                                                                    
                                                                                                    

Text extraction - CODE SNIPPETS


curl --location --request POST 'https://zylalabs.com/api/11262/photo+to+text+conversion+api/21265/text+extraction?image_url=https://static-content.regulaforensics.com/Hardware-products/knowledge_hub/glossary_documents/PASSPORT/2l.webp' --header 'Authorization: Bearer YOUR_API_KEY' 


    

API Access Key & Authentication

After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the Photo to Text Conversion API simply include your bearer token in the Authorization header.
Headers
Header Description
Authorization [Required] Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.

Simple Transparent Pricing

No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.

🚀 Enterprise

Starts at
$ 10,000/Year


  • Custom Volume
  • Custom Rate Limit
  • Specialized Customer Support
  • Real-Time API Monitoring

Customer favorite features

  • ✔︎ Only Pay for Successful Requests
  • ✔︎ Free 7-Day Trial
  • ✔︎ Multi-Language Support
  • ✔︎ One API Key, All APIs.
  • ✔︎ Intuitive Dashboard
  • ✔︎ Comprehensive Error Handling
  • ✔︎ Developer-Friendly Docs
  • ✔︎ Postman Integration
  • ✔︎ Secure HTTPS Connections
  • ✔︎ Reliable Uptime

Photo to Text Conversion API FAQs

The Text extraction endpoint returns structured data that includes recognized text, bounding box coordinates for each word, line, and block, confidence scores indicating recognition accuracy, and a hierarchical organization of the text (blocks, paragraphs, lines, words).

Key fields in the response data include "text" (the recognized content), "coordinates" (bounding box positions), "confidence" (accuracy score), and "hierarchy" (structure indicating blocks, paragraphs, lines, and words).

The response data is organized hierarchically, with blocks containing paragraphs, paragraphs containing lines, and lines containing individual words. This structure allows for easy navigation and analysis of the extracted text.

The endpoint provides information such as recognized text, its location within the image, confidence levels for each recognition, and formatting details like punctuation and capitalization, making it suitable for various document types.

Users can customize their requests by specifying parameters such as image format, language settings, and desired output structure, allowing for tailored extraction based on specific document types or requirements.

Data accuracy is maintained through advanced optical character recognition algorithms that include confidence scoring for each recognized element, enabling users to filter results based on their reliability.

Typical use cases include digitizing scanned documents, automating data entry from forms or invoices, and building document reading systems for identity verification or auditing purposes.

Users should check the confidence scores in the response; low scores may indicate partial or inaccurate results. Implementing a review process for low-confidence entries can help ensure data quality and completeness.

General FAQs

Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.

Prices are listed in USD (United States Dollar), EUR (Euro), CAD (Canadian Dollar), AUD (Australian Dollar), and GBP (British Pound). We accept all major debit and credit cards. Our payment system uses the latest security technology and is powered by Stripe, one of the world's most reliable payment companies. If you have any trouble paying by card, just contact us at [email protected]


Additionally, if you already have an active subscription in any of these currencies (USD, EUR, CAD, AUD, GBP), that currency will remain for subsequent subscriptions. You can change the currency at any time as long as you don't have any active subscriptions.

The local currency shown on the pricing page is based on the country of your IP address and is provided for reference only. The actual prices are in USD (United States Dollar). When you make a payment, the charge will appear on your card statement in USD, even if you see the equivalent amount in your local currency on our website. This means you cannot pay directly with your local currency.

Occasionally, a bank may decline the charge due to its fraud protection settings. We suggest reaching out to your bank initially to check if they are blocking our charges. Also, you can access the Billing Portal and change the card associated to make the payment. If these does not work and you need further assistance, please contact our team at [email protected]

Prices are determined by a recurring monthly or yearly subscription, depending on the chosen plan.

API calls are deducted from your plan based on successful requests. Each plan comes with a specific number of calls that you can make per month. Only successful calls, indicated by a Status 200 response, will be counted against your total. This ensures that failed or incomplete requests do not impact your monthly quota.

Zyla API Hub works on a recurring monthly subscription system. Your billing cycle will start the day you purchase one of the paid plans, and it will renew the same day of the next month. So be aware to cancel your subscription beforehand if you want to avoid future charges.

To upgrade your current subscription plan, simply go to the pricing page of the API and select the plan you want to upgrade to. The upgrade will be instant, allowing you to immediately enjoy the features of the new plan. Please note that any remaining calls from your previous plan will not be carried over to the new plan, so be aware of this when upgrading. You will be charged the full amount of the new plan.

To check how many API calls you have left for the current month, refer to the 'X-Zyla-API-Calls-Monthly-Remaining' field in the response header. For example, if your plan allows 1,000 requests per month and you've used 100, this field in the response header will indicate 900 remaining calls.

To see the maximum number of API requests your plan allows, check the 'X-Zyla-RateLimit-Limit' response header. For instance, if your plan includes 1,000 requests per month, this header will display 1,000.

The 'X-Zyla-RateLimit-Reset' header shows the number of seconds until your rate limit resets. This tells you when your request count will start fresh. For example, if it displays 3,600, it means 3,600 seconds are left until the limit resets.

Yes, you can cancel your plan anytime by going to your account and selecting the cancellation option on the Billing page. Please note that upgrades, downgrades, and cancellations take effect immediately. Additionally, upon cancellation, you will no longer have access to the service, even if you have remaining calls left in your quota.

You can contact us through our chat channel to receive immediate assistance. We are always online from 8 am to 5 pm (EST). If you reach us after that time, we will get back to you as soon as possible. Additionally, you can contact us via email at [email protected]

To give you the opportunity to experience our APIs without any commitment, we offer a 7-day free trial that allows you to make up to 50 API calls at no cost. This trial can be used only once, so we recommend applying it to the API that interests you the most. While most of our APIs offer a free trial, some may not. The trial concludes after 7 days or once you've made 50 requests, whichever occurs first. If you reach the 50 request limit during the trial, you will need to "Start Your Paid Plan" to continue making requests. You can find the "Start Your Paid Plan" button in your profile under Subscription -> Choose the API you are subscribed to -> Pricing tab. Alternatively, if you don't cancel your subscription before the 7th day, your free trial will end, and your plan will automatically be billed, granting you access to all the API calls specified in your plan. Please keep this in mind to avoid unwanted charges.

After 7 days, you will be charged the full amount for the plan you were subscribed to during the trial. Therefore, it's important to cancel before the trial period ends. Refund requests for forgetting to cancel on time are not accepted.

When you subscribe to an API free trial, you can make up to 50 API calls. If you wish to make additional API calls beyond this limit, the API will prompt you to perform an "Start Your Paid Plan." You can find the "Start Your Paid Plan" button in your profile under Subscription -> Choose the API you are subscribed to -> Pricing tab.

Payout Orders are processed between the 20th and the 30th of each month. If you submit your request before the 20th, your payment will be processed within this timeframe.


Related APIs


You might also like