Get a document
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");curl_easy_setopt(hnd, CURLOPT_URL, "https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7?expand=model&fields%5Bmodel%5D=id%2Cname%2Cversion");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "X-Api-Key: <X-Api-Key>");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Get, RequestUri = new Uri("https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7?expand=model&fields%5Bmodel%5D=id%2Cname%2Cversion"), Headers = { { "X-Api-Key", "<X-Api-Key>" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7?expand=model&fields%5Bmodel%5D=id%2Cname%2Cversion"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<X-Api-Key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7?expand=model&fields%5Bmodel%5D=id%2Cname%2Cversion")) .header("X-Api-Key", "<X-Api-Key>") .method("GET", HttpRequest.BodyPublishers.noBody()) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7?expand=model&fields%5Bmodel%5D=id%2Cname%2Cversion") .get() .addHeader("X-Api-Key", "<X-Api-Key>") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'GET', url: 'https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7', params: {expand: 'model', 'fields[model]': 'id,name,version'}, headers: {'X-Api-Key': '<X-Api-Key>'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7?expand=model&fields%5Bmodel%5D=id%2Cname%2Cversion';const options = {method: 'GET', headers: {'X-Api-Key': '<X-Api-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val request = Request.Builder() .url("https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7?expand=model&fields%5Bmodel%5D=id%2Cname%2Cversion") .get() .addHeader("X-Api-Key", "<X-Api-Key>") .build()
val response = client.newCall(request).execute()use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7";
let querystring = [ ("expand", "model"), ("fields[model]", "id,name,version"), ];
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("X-Api-Key", "<X-Api-Key>".parse().unwrap());
let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request GET \ --url 'https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7?expand=model&fields%5Bmodel%5D=id%2Cname%2Cversion' \ --header 'X-Api-Key: <X-Api-Key>'wget --quiet \ --method GET \ --header 'X-Api-Key: <X-Api-Key>' \ --output-document \ - 'https://api.langparse.dev/api/v1/documents/doc_mrb1x9y8z7?expand=model&fields%5Bmodel%5D=id%2Cname%2Cversion'Fetch a document’s status and, once processed, its structured data + located fields.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
doc_mrb1x9y8z7Query Parameters
Section titled “Query Parameters”Comma-separated relations to inline. model replaces the model id string with { id, name }; documents.model expands split sub-documents. Shallow (one hop).
Example
modelFields for an expanded model (allowed: id, name, version, geometry). Default: id,name.
Example
id,name,versionResponses
Section titled “Responses”The document.
object
object
The extracted structured data (present once processed).
object
Per-field values + confidence + bounding boxes (when resultShape=full).
object
Any JSON value (string/number/boolean/array/object).
Normalised page coordinates (0..1).
object
Example
{ "data": { "id": "doc_mrb1x9y8z7", "model": "mdl_inv01", "status": "processed", "pageCount": 2, "data": { "invoice_number": "INV-23815", "invoice_date": "2024-04-12", "total": 1284.5 }, "fields": [ { "name": "invoice_number", "value": "INV-23815", "confidence": "high", "boxes": [ { "left": 0.62, "top": 0.08, "width": 0.15, "height": 0.03, "page": 1 } ] }, { "name": "total", "value": 1284.5, "confidence": "high", "boxes": [] } ] }}Missing or invalid API key.
Error response. statusCode mirrors the HTTP status; statusMessage is human-readable.
object
Example
{ "statusCode": 404, "statusMessage": "Document not found"}Document not found.
Error response. statusCode mirrors the HTTP status; statusMessage is human-readable.
object
Example
{ "statusCode": 404, "statusMessage": "Document not found"}