Programming Language Identification

Detect the programming language of source code

Algorithmia Platform License · Internet Access

This algorithm has Internet access.

This is necessary for algorithms that rely on external services, however it also implies that this algorithm is able to send your input data outside of the Algorithmia platform.

Run an Example

[
  [
    "javascript",
    0.9898891716577287
  ],
  [
    "markdown",
    0.003837364611352916
  ],
  [
    "java",
    0.0018736157456299308
  ],
  [
    "php",
    0.0017531876463711639
  ],
  [
    "c",
    0.0009585207454160043
  ],
  [
    "lua",
    0.0007419186073970404
  ],
  [
    "html",
    0.0003518026874305513
  ],
  [
    "objective-c",
    0.0002779842516112652
  ],
  [
    "sql",
    0.00017283418084344316
  ],
  [
    "css",
    0.000038611774005519745
  ],
  [
    "c++",
    0.0000343903914437696
  ],
  [
    "swift",
    0.00003122888156291078
  ],
  [
    "bash",
    0.000013677125153852474
  ],
  [
    "ruby",
    0.00001224731478181401
  ],
  [
    "perl",
    0.000005581660035943508
  ],
  [
    "c#",
    0.0000038442524620865925
  ],
  [
    "scala",
    0.000003723956933340254
  ],
  [
    "python",
    1.572113560595084e-7
  ],
  [
    "r",
    6.431838326426007e-8
  ],
  [
    "haskell",
    4.036764786336715e-8
  ],
  [
    "vb",
    3.261245241114874e-8
  ]
]

Install & Use

Use

curl -X POST -d '"/* Simple JavaScript example */\n\n// add two numbers\nfunction add(n, m) {\n  return n + m;\n}"' -H 'Content-Type: application/json' -H 'Authorization: Simple YOUR_API_KEY' https://api.algorithmia.com/v1/algo/PetiteProgrammer/ProgrammingLanguageIdentification/0.1.3