NAV
shell csharp

Introduction

Welcome to the LCPDFR.com public website API.

Download Center

Authorization

For public download center API calls, no authentication is needed. You should however try to ensure your client gives a unique User-Agent. Calls without a User-Agent may be throttled.

Get user-facing version for a file

curl "https://www.lcpdfr.com/applications/downloadsng/interface/api.php" \
  -H "User-Agent: CyanCallouts/1.0 (+https://www.lcpdfr.com/profile/9-cyan/)" \
  -d "do=checkForUpdates" \
  -d "fileId=7792" \
  -d "textOnly=1"

  public static string GetLatestVersion(int fileId)
  {
      string updateEndpoint = "http://www.lcpdfr.com/applications/downloadsng/interface/api.php?do=checkForUpdates&fileId={0}&textOnly=true";
      string latestVersion = null;
      try {
          using(WebClient client = new WebClient()) {
              client.Headers.Add("user-agent", "CyanCallouts/1.0 (+https://www.lcpdfr.com/profile/9-cyan/)");
              latestVersion = client.DownloadString(string.Format(updateEndpoint, fileId));
          }
      }
      catch(Exception e) {
              // Failed. Maybe log the exception.
      }
      return latestVersion;
  }

The above command returns a text only response of the author provided file version.

0.4.9 (Build 8678)

This endpoint retrieves the latest author provided version of a file, given a file ID.

HTTP Request

GET https://www.lcpdfr.com/applications/downloadsng/interface/api.php

Query Parameters

Parameter Default Description
do null Needs set to 'checkForUpdates'
fileId null The file ID to query
textOnly false Set to true to provide a text only (non JSON) response.

Get .NET assembly versions for a file

curl "https://www.lcpdfr.com/applications/downloadsng/interface/api.php" \
  -H "User-Agent: CyanCallouts/1.0 (+https://www.lcpdfr.com/profile/9-cyan/)" \
  -d "do=getAssemblies" \
  -d "fileId=7792" 
/*
 * This is an example of an async function that tries to retrieve the latest LSPDFR assembly version
 */
using System.Text.Json;
using System.Net;
using System;

public class AssemblyInfoRetriever
{
    private static readonly HttpClient client = new HttpClient();

    public static async Task<string> GetLSPDFRAssemblyVersionAsync()
    {
        string url = "https://www.lcpdfr.com/applications/downloadsng/interface/api.php?do=getAssemblies&fileId=7792";
        string assemblyVersion = null;

        try
        {
            var response = await client.GetStringAsync(url);
            using (JsonDocument doc = JsonDocument.Parse(response))
            {
                JsonElement root = doc.RootElement;
                string error = root.GetProperty("error").GetString();

                if (string.IsNullOrEmpty(error))
                {
                    foreach(JsonProperty file in root.GetProperty("result").GetProperty("files").EnumerateObject()) {
                        if (file.Value.TryGetProperty("plugins/LSPD First Response.dll", out JsonElement versionElement)) {
                            assemblyVersion = versionElement.GetString();
                        }
                    }
                }
            }
            if(assemblyVersion == null) {
                throw new Exception("Couldn't find LSPDFR dll within result!");
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("Error occurred: " + ex.Message);
        }

        return assemblyVersion;
    }
}

The above command returns JSON structured like this:


{
  "error": "",
  "result": {
    "files": {
      "lspdfr_049_8678_setup.exe": {},
      "LSPDFR_049_8678_Manual_Install.zip": {
        "DdsConvert.dll": "1.0.0.0",
        "DiscordRpcNet.dll": "1.0.0.0",
        "EasyHook.dll": "2.7.6578.0",
        "EasyLoad64.dll": "2.7.6578.0",
        "Gwen.dll": "1.0.0.0",
        "Gwen.UnitTest.dll": "1.0.0.0",
        "LMS.Common.dll": "1.0.0.0",
        "LMS.PortableExecutable.dll": "1.0.0.0",
        "lspdfr\/LSPDFR Configurator.exe": "1.0.0.0",
        "lspdfr\/Microsoft.Expression.Drawing.dll": "4.5.0.0",
        "Microsoft.Expression.Drawing.dll": "4.5.0.0",
        "Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll": "10.0.0.0",
        "Mono.Cecil.dll": "0.9.6.0",
        "Mono.Cecil.Mdb.dll": "0.9.6.0",
        "Mono.Cecil.Pdb.dll": "0.9.6.0",
        "Mono.Cecil.Rocks.dll": "0.9.6.0",
        "plugins\/LSPD First Response.dll": "0.4.8678.25591",
        "RAGEPluginHook.exe": "1.0.0.0",
        "SlimDX.dll": "4.0.13.43",
        "System.ValueTuple.dll": "4.0.2.0"
      }
    }
  }
}

This endpoint retrieves all .NET assemblies inside all subfiles on a file submission.

HTTP Request

GET https://www.lcpdfr.com/applications/downloadsng/interface/api.php

URL Parameters

Parameter Default Description
do null Needs set to 'getAssemblies'
fileId null The file ID to query