Public APIs
Code Detection API favicon

Code Detection API

Text Analysis

Detect, label, format and enrich the code in your app or in your data pipeline.

Code Detection API's website screenshot

About Code Detection API

Code Detection API is a machine learning-based service that determines whether a given text string contains code, identifies the programming language of detected snippets, and returns a formatted, syntax-highlighted version of the code. It is offered by Runtime as the first in a planned line of Technical Language Processing APIs aimed at processing unstructured technical text.

The service targets two groups: app developers who want to distinguish code from plain text in features like notes, messages, code editors, or blog/publication platforms, and AI, machine learning, and analytics teams who need to identify, label, and enrich code within large datasets or data pipelines where code is mixed with natural language. Cited use cases include improving in-app search by tagging snippets as code, and scrubbing data pipelines to separate code from text.

Separate pricing tracks exist for App Developers and for AI and Machine Learning teams, each with Basic, Pro, and Enterprise tiers plus a custom-priced option, billed monthly or yearly. Plans are differentiated by API credit allotments and feature sets such as text-vs-code detection, code classification, model metadata, confidence intervals on language and text classification, user-specific bias, batched requests (AI/ML tier only, with per-call and total batch limits), noise reduction and embedding/tokenizer support on higher AI/ML tiers, and tag generation listed as a coming-soon feature across paid tiers. A 14-day free trial is offered. Case studies mention integration with the Pieces.app snippet tool and use in a machine learning pipeline.

Key features

  • Detects whether a given text string contains a code snippet using machine learning models
  • Identifies the programming language of code snippets within text
  • Returns formatted, syntax-highlighted versions of detected code snippets
  • Provides confidence intervals for code vs. text and language classification (Pro/Enterprise plans)
  • Supports batched requests for processing large data pipelines (App Developers Pro/Enterprise plans)

Frequently asked questions

Is there a free tier or trial?

Yes, there is a 14 day free trial across all plans.

What pricing plans are available?

App Developer plans start at $19.99/month (Basic) up to $319.99/month (Enterprise), with AI/ML team plans ranging from $39.99/month (Basic) to $359.99/month (Enterprise); custom pricing is available for larger needs.

Who is this API for?

It's built for app developers who want to detect and format code in their apps, and for AI/ML and analytics teams who need to label and enrich code within large datasets.

What can the API detect and return?

It can classify whether text contains code, detect the code's language, and return formatted, syntax-highlighted snippets with metadata.

Does it support batch processing?

Yes, AI/ML team plans include batched requests, with limits ranging from 100 to 400 maxed batch requests per call depending on the plan.

Advertise here

Featured products

  • SerpApi - Search API favicon
  • Screenshot Scout favicon
  • TalorData favicon
  • CoreClaw favicon

Show your product to thousands of developers

· 100k monthly pageviews
· 7k newsletter subscribers

Advertise your product