LatexConvert Image to LaTeX API avatar

LatexConvert Image to LaTeX API

Pricing

from $1.50 / 1,000 results

Go to Apify Store
LatexConvert Image to LaTeX API

LatexConvert Image to LaTeX API

Convert formula images, screenshots, and equation URLs into clean LaTeX with the LatexConvert API. Provided by latexconvert.com

Pricing

from $1.50 / 1,000 results

Rating

0.0

(0)

Developer

latexconvert

latexconvert

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

17 days ago

Last modified

Share

Convert formula image URLs and uploaded image files into LaTeX with LatexConvert. This Actor is a paid proxy for the LatexConvert API and writes one result row per input image to the default Dataset.

Input

{
"imageUrls": [
"https://example.com/formula.png"
],
"uploadedImages": []
}
  • imageUrls: Public HTTP or HTTPS image URLs.
  • uploadedImages: Image files uploaded in the Apify Console.

Provide at least one image URL or uploaded image. You can use both input methods in the same run.

API usage

Set these environment variables before running the examples:

export APIFY_TOKEN="YOUR_APIFY_TOKEN"
export ACTOR_ID="RuUmfScEITpPXeUU0"

Image URL with curl

curl -sS -X POST "https://api.apify.com/v2/acts/$ACTOR_ID/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"imageUrls":["https://example.com/formula.png"]}'

Image URL with Python

Install the dependency:

$python3 -m pip install requests
import json
import os
import requests
APIFY_TOKEN = os.environ["APIFY_TOKEN"]
ACTOR_ID = os.environ.get("ACTOR_ID", "RuUmfScEITpPXeUU0")
url = f"https://api.apify.com/v2/acts/{ACTOR_ID}/run-sync-get-dataset-items"
payload = {
"imageUrls": ["https://example.com/formula.png"],
}
response = requests.post(
url,
headers={
"Authorization": f"Bearer {APIFY_TOKEN}",
"Content-Type": "application/json",
},
json=payload,
timeout=360,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2, ensure_ascii=False))

Local file with curl

This example uploads a local image into an Apify key-value store, then passes the uploaded record URL to the Actor. It requires jq.

export IMAGE_FILE="img/taileformula.png"
export RECORD_KEY="image-$(date +%s)-$(basename "$IMAGE_FILE")"
export CONTENT_TYPE="$(file --brief --mime-type "$IMAGE_FILE")"
export STORE_ID="$(curl -sS -X POST "https://api.apify.com/v2/key-value-stores" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
| jq -r '.data.id')"
curl -sS -X PUT "https://api.apify.com/v2/key-value-stores/$STORE_ID/records/$RECORD_KEY" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: $CONTENT_TYPE" \
--data-binary "@$IMAGE_FILE"
export FILE_URL="https://api.apify.com/v2/key-value-stores/$STORE_ID/records/$RECORD_KEY?token=$APIFY_TOKEN"
curl -sS -X POST "https://api.apify.com/v2/acts/$ACTOR_ID/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"uploadedImages\":[\"$FILE_URL\"]}"

Local file with Python

import json
import mimetypes
import os
import pathlib
import time
import requests
APIFY_TOKEN = os.environ["APIFY_TOKEN"]
ACTOR_ID = os.environ.get("ACTOR_ID", "RuUmfScEITpPXeUU0")
IMAGE_FILE = pathlib.Path(os.environ.get("IMAGE_FILE", "img/taileformula.png"))
APIFY_API_BASE = "https://api.apify.com/v2"
headers = {
"Authorization": f"Bearer {APIFY_TOKEN}",
}
store_response = requests.post(
f"{APIFY_API_BASE}/key-value-stores",
headers={**headers, "Content-Type": "application/json"},
timeout=60,
)
store_response.raise_for_status()
store_id = store_response.json()["data"]["id"]
record_key = f"image-{int(time.time())}-{IMAGE_FILE.name}"
content_type = mimetypes.guess_type(IMAGE_FILE.name)[0] or "application/octet-stream"
record_url = f"{APIFY_API_BASE}/key-value-stores/{store_id}/records/{record_key}"
upload_response = requests.put(
record_url,
headers={**headers, "Content-Type": content_type},
data=IMAGE_FILE.read_bytes(),
timeout=120,
)
upload_response.raise_for_status()
uploaded_image_url = f"{record_url}?token={APIFY_TOKEN}"
run_url = f"{APIFY_API_BASE}/acts/{ACTOR_ID}/run-sync-get-dataset-items"
run_response = requests.post(
run_url,
headers={**headers, "Content-Type": "application/json"},
json={"uploadedImages": [uploaded_image_url]},
timeout=360,
)
run_response.raise_for_status()
print(json.dumps(run_response.json(), indent=2, ensure_ascii=False))

In the Apify Console, use the Uploaded images field to upload files directly instead of creating the key-value store yourself.

Output

Each image produces one Dataset item:

{
"index": 0,
"inputType": "imageUrl",
"imageUrl": "https://example.com/formula.png",
"uploadedImage": null,
"success": true,
"latex": "E = mc^2",
"errorCode": null,
"error": null,
"mimeType": "image/png",
"processingTimeMs": 1350,
"requestId": "run-id-0"
}

If no formula is found, the Actor returns a structured error row instead of failing the whole run:

{
"index": 0,
"inputType": "imageUrl",
"imageUrl": "https://example.com/photo.jpg",
"uploadedImage": null,
"success": false,
"latex": null,
"errorCode": "NO_FORMULAS_FOUND",
"error": "No mathematical formulas found in the image.",
"mimeType": null,
"processingTimeMs": 1200,
"requestId": "run-id-0"
}

Pricing

The Actor charges one image-conversion-attempt event for each valid image URL or accepted uploaded-image reference before it is sent to the conversion API. Each event costs $0.0015, so a run with N chargeable image inputs costs N * $0.0015, plus any standard Apify platform usage costs. The charge applies even if no formula is found, because the image still has to be analyzed by the conversion engine.

Invalid image URL input, such as a non-HTTP URL, is rejected before charging. Uploaded images are charged once the file reference is accepted for processing.

Set ALLOW_UNCHARGED_RUNS=true only for private testing before Pay per event pricing is enabled. Set ALLOW_UNCHARGED_RUNS=false for public monetized runs so each valid image attempt is charged through Apify.

Limits

  • Maximum 10 image URLs per run.
  • Maximum 10 uploaded images per run.
  • Maximum uploaded image size is 10 MB.
  • Images are processed one at a time to keep conversion reliability stable.
  • Supported image formats are JPEG, PNG, GIF, and WebP.
  • The conversion API may reject oversized images, private network URLs, unsupported formats, or slow image downloads.

Accuracy

Results depend on image quality. Clear printed equations usually work best. Low-resolution screenshots, cropped formulas, handwritten math, unusual notation, or heavy visual noise can reduce accuracy.