> ## Documentation Index
> Fetch the complete documentation index at: https://docs.veritus.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples and Notes

> Additional examples and important notes for using the API

## Examples

### Keyword Search Example

See the [Keyword Search Job](/learn/search-api/jobs-keyword-search) endpoint documentation for details.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST "https://discover.veritus.ai/api/v1/job/keywordSearch?limit=100&fieldsOfStudy=Computer%20Science&minCitationCount=10" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "keywords": ["machine learning", "neural networks", "deep learning"],
      "callbackUrl": "https://your-domain.com/webhook",
      "enrich": true
    }'
  ```

  ```python python theme={null}
  import requests

  response = requests.post(
      "https://discover.veritus.ai/api/v1/job/keywordSearch?limit=100&fieldsOfStudy=Computer%20Science&minCitationCount=10",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json"
      },
      json={
          "keywords": ["machine learning", "neural networks", "deep learning"],
          "callbackUrl": "https://your-domain.com/webhook",
          "enrich": True
      }
  )
  print(response.json())
  ```

  ```javascript javascript theme={null}
  const response = await fetch(
    "https://discover.veritus.ai/api/v1/job/keywordSearch?limit=100&fieldsOfStudy=Computer%20Science&minCitationCount=10",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        keywords: ["machine learning", "neural networks", "deep learning"],
        callbackUrl: "https://your-domain.com/webhook",
        enrich: true
      })
    }
  );
  const data = await response.json();
  console.log(data);
  ```

  ```go go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
      "io"
  )

  func main() {
      payload := map[string]interface{}{
          "keywords": []string{"machine learning", "neural networks", "deep learning"},
          "callbackUrl": "https://your-domain.com/webhook",
          "enrich": true,
      }
      jsonData, _ := json.Marshal(payload)
      
      req, _ := http.NewRequest("POST", "https://discover.veritus.ai/api/v1/job/keywordSearch?limit=100&fieldsOfStudy=Computer%20Science&minCitationCount=10", bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
      req.Header.Set("Content-Type", "application/json")
      
      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()
      
      body, _ := io.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```
</CodeGroup>

### Query Search Example

See the [Query Search Job](/learn/search-api/jobs-query-search) endpoint documentation for details.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST "https://discover.veritus.ai/api/v1/job/querySearch?limit=200&year=2020:2023" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "query": "This is a detailed query about machine learning and artificial intelligence that describes what you are looking for in academic papers.",
      "callbackUrl": "https://your-domain.com/webhook"
    }'
  ```

  ```python python theme={null}
  import requests

  response = requests.post(
      "https://discover.veritus.ai/api/v1/job/querySearch?limit=200&year=2020:2023",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json"
      },
      json={
          "query": "This is a detailed query about machine learning and artificial intelligence that describes what you are looking for in academic papers.",
          "callbackUrl": "https://your-domain.com/webhook"
      }
  )
  print(response.json())
  ```

  ```javascript javascript theme={null}
  const response = await fetch(
    "https://discover.veritus.ai/api/v1/job/querySearch?limit=200&year=2020:2023",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        query: "This is a detailed query about machine learning and artificial intelligence that describes what you are looking for in academic papers.",
        callbackUrl: "https://your-domain.com/webhook"
      })
    }
  );
  const data = await response.json();
  console.log(data);
  ```

  ```go go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
      "io"
  )

  func main() {
      payload := map[string]interface{}{
          "query": "This is a detailed query about machine learning and artificial intelligence that describes what you are looking for in academic papers.",
          "callbackUrl": "https://your-domain.com/webhook",
      }
      jsonData, _ := json.Marshal(payload)
      
      req, _ := http.NewRequest("POST", "https://discover.veritus.ai/api/v1/job/querySearch?limit=200&year=2020:2023", bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
      req.Header.Set("Content-Type", "application/json")
      
      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()
      
      body, _ := io.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```
</CodeGroup>

### Combined Search Example

See the [Combined Search Job](/learn/search-api/jobs-combined-search) endpoint documentation for details.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST "https://discover.veritus.ai/api/v1/job/combinedSearch?limit=300&openAccessPdf=true&quartileRanking=Q1,Q2&sort=citationCount:desc" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "keywords": ["natural language processing", "transformer models", "BERT"],
      "query": "Recent advances in transformer-based models for natural language understanding and generation",
      "callbackUrl": "https://your-domain.com/webhook",
      "enrich": true
    }'
  ```

  ```python python theme={null}
  import requests

  response = requests.post(
      "https://discover.veritus.ai/api/v1/job/combinedSearch?limit=300&openAccessPdf=true&quartileRanking=Q1,Q2&sort=citationCount:desc",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json"
      },
      json={
          "keywords": ["natural language processing", "transformer models", "BERT"],
          "query": "Recent advances in transformer-based models for natural language understanding and generation",
          "callbackUrl": "https://your-domain.com/webhook",
          "enrich": True
      }
  )
  print(response.json())
  ```

  ```javascript javascript theme={null}
  const response = await fetch(
    "https://discover.veritus.ai/api/v1/job/combinedSearch?limit=300&openAccessPdf=true&quartileRanking=Q1,Q2&sort=citationCount:desc",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        keywords: ["natural language processing", "transformer models", "BERT"],
        query: "Recent advances in transformer-based models for natural language understanding and generation",
        callbackUrl: "https://your-domain.com/webhook",
        enrich: true
      })
    }
  );
  const data = await response.json();
  console.log(data);
  ```

  ```go go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "net/http"
      "io"
  )

  func main() {
      payload := map[string]interface{}{
          "keywords": []string{"natural language processing", "transformer models", "BERT"},
          "query": "Recent advances in transformer-based models for natural language understanding and generation",
          "callbackUrl": "https://your-domain.com/webhook",
          "enrich": true,
      }
      jsonData, _ := json.Marshal(payload)
      
      req, _ := http.NewRequest("POST", "https://discover.veritus.ai/api/v1/job/combinedSearch?limit=300&openAccessPdf=true&quartileRanking=Q1,Q2&sort=citationCount:desc", bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
      req.Header.Set("Content-Type", "application/json")
      
      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()
      
      body, _ := io.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```
</CodeGroup>

## Important Notes

1. **Callback URLs**: Must be valid HTTPS URLs. Localhost URLs are not allowed.
2. **Query Length**: For query and combined searches, queries must be between 50 and 5000 characters.
3. **Keywords**: For keyword and combined searches, you must provide between 3 and 10 keywords.
4. **Rate Limiting**: API rate limits may apply (10 req/min).
5. **Job Processing**: Jobs are processed asynchronously. Use the callback URL or poll the [job status endpoint](/learn/search-api/jobs-status) to check completion.
6. **Field Names**: Field names in query parameters are case-sensitive. Use exact values as specified in the documentation.

## Contact and Support

Need help or onboarding support?

**Email:** [support@veritus.ai](mailto:support@veritus.ai)\
**Website:** [www.veritus.ai](https://www.veritus.ai)\
**Offices:** Tokyo & Kobe, Japan

Veritus is backed by academic and government partners including JETRO, OIST Innovation Accelerator, and Lifetime Ventures Japan.
