flonat-research 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/.claude/agents/domain-reviewer.md +336 -0
  2. package/.claude/agents/fixer.md +226 -0
  3. package/.claude/agents/paper-critic.md +370 -0
  4. package/.claude/agents/peer-reviewer.md +289 -0
  5. package/.claude/agents/proposal-reviewer.md +215 -0
  6. package/.claude/agents/referee2-reviewer.md +367 -0
  7. package/.claude/agents/references/journal-referee-profiles.md +354 -0
  8. package/.claude/agents/references/paper-critic/council-personas.md +77 -0
  9. package/.claude/agents/references/paper-critic/council-prompts.md +198 -0
  10. package/.claude/agents/references/peer-reviewer/report-template.md +199 -0
  11. package/.claude/agents/references/peer-reviewer/sa-prompts.md +260 -0
  12. package/.claude/agents/references/peer-reviewer/security-scan.md +188 -0
  13. package/.claude/agents/references/proposal-reviewer/report-template.md +144 -0
  14. package/.claude/agents/references/proposal-reviewer/sa-prompts.md +149 -0
  15. package/.claude/agents/references/referee-config.md +114 -0
  16. package/.claude/agents/references/referee2-reviewer/audit-checklists.md +287 -0
  17. package/.claude/agents/references/referee2-reviewer/report-template.md +334 -0
  18. package/.claude/rules/design-before-results.md +52 -0
  19. package/.claude/rules/ignore-agents-md.md +17 -0
  20. package/.claude/rules/ignore-gemini-md.md +17 -0
  21. package/.claude/rules/lean-claude-md.md +45 -0
  22. package/.claude/rules/learn-tags.md +99 -0
  23. package/.claude/rules/overleaf-separation.md +67 -0
  24. package/.claude/rules/plan-first.md +175 -0
  25. package/.claude/rules/read-docs-first.md +50 -0
  26. package/.claude/rules/scope-discipline.md +28 -0
  27. package/.claude/settings.json +125 -0
  28. package/.context/current-focus.md +33 -0
  29. package/.context/preferences/priorities.md +36 -0
  30. package/.context/preferences/task-naming.md +28 -0
  31. package/.context/profile.md +29 -0
  32. package/.context/projects/_index.md +41 -0
  33. package/.context/projects/papers/nudge-exp.md +22 -0
  34. package/.context/projects/papers/uncertainty.md +31 -0
  35. package/.context/resources/claude-scientific-writer-review.md +48 -0
  36. package/.context/resources/cunningham-multi-analyst-agents.md +104 -0
  37. package/.context/resources/cunningham-multilang-code-audit.md +62 -0
  38. package/.context/resources/google-ai-co-scientist-review.md +72 -0
  39. package/.context/resources/karpathy-llm-council-review.md +58 -0
  40. package/.context/resources/multi-coder-reliability-protocol.md +175 -0
  41. package/.context/resources/pedro-santanna-takeaways.md +96 -0
  42. package/.context/resources/venue-rankings/abs_ajg_2024.csv +1823 -0
  43. package/.context/resources/venue-rankings/abs_ajg_2024_econ.csv +356 -0
  44. package/.context/resources/venue-rankings/cabs_4_4star_theory.csv +40 -0
  45. package/.context/resources/venue-rankings/core_2026.csv +801 -0
  46. package/.context/resources/venue-rankings.md +147 -0
  47. package/.context/workflows/README.md +69 -0
  48. package/.context/workflows/daily-review.md +91 -0
  49. package/.context/workflows/meeting-actions.md +108 -0
  50. package/.context/workflows/replication-protocol.md +155 -0
  51. package/.context/workflows/weekly-review.md +113 -0
  52. package/.mcp-server-biblio/formatters.py +158 -0
  53. package/.mcp-server-biblio/pyproject.toml +11 -0
  54. package/.mcp-server-biblio/server.py +678 -0
  55. package/.mcp-server-biblio/sources/__init__.py +14 -0
  56. package/.mcp-server-biblio/sources/base.py +73 -0
  57. package/.mcp-server-biblio/sources/formatters.py +83 -0
  58. package/.mcp-server-biblio/sources/models.py +22 -0
  59. package/.mcp-server-biblio/sources/multi_source.py +243 -0
  60. package/.mcp-server-biblio/sources/openalex_source.py +183 -0
  61. package/.mcp-server-biblio/sources/scopus_source.py +309 -0
  62. package/.mcp-server-biblio/sources/wos_source.py +508 -0
  63. package/.mcp-server-biblio/uv.lock +896 -0
  64. package/.scripts/README.md +161 -0
  65. package/.scripts/ai_pattern_density.py +446 -0
  66. package/.scripts/conf +445 -0
  67. package/.scripts/config.py +122 -0
  68. package/.scripts/count_inventory.py +275 -0
  69. package/.scripts/daily_digest.py +288 -0
  70. package/.scripts/done +177 -0
  71. package/.scripts/extract_meeting_actions.py +223 -0
  72. package/.scripts/focus +176 -0
  73. package/.scripts/generate-codex-agents-md.py +217 -0
  74. package/.scripts/inbox +194 -0
  75. package/.scripts/notion_helpers.py +325 -0
  76. package/.scripts/openalex/query_helpers.py +306 -0
  77. package/.scripts/papers +227 -0
  78. package/.scripts/query +223 -0
  79. package/.scripts/session-history.py +201 -0
  80. package/.scripts/skill-health.py +516 -0
  81. package/.scripts/skill-log-miner.py +273 -0
  82. package/.scripts/sync-to-codex.sh +252 -0
  83. package/.scripts/task +213 -0
  84. package/.scripts/tasks +190 -0
  85. package/.scripts/week +206 -0
  86. package/CLAUDE.md +197 -0
  87. package/LICENSE +21 -0
  88. package/MEMORY.md +38 -0
  89. package/README.md +269 -0
  90. package/docs/agents.md +44 -0
  91. package/docs/bibliography-setup.md +55 -0
  92. package/docs/council-mode.md +36 -0
  93. package/docs/getting-started.md +245 -0
  94. package/docs/hooks.md +38 -0
  95. package/docs/mcp-servers.md +82 -0
  96. package/docs/notion-setup.md +109 -0
  97. package/docs/rules.md +33 -0
  98. package/docs/scripts.md +303 -0
  99. package/docs/setup-overview/setup-overview.pdf +0 -0
  100. package/docs/skills.md +70 -0
  101. package/docs/system.md +159 -0
  102. package/hooks/block-destructive-git.sh +66 -0
  103. package/hooks/context-monitor.py +114 -0
  104. package/hooks/postcompact-restore.py +157 -0
  105. package/hooks/precompact-autosave.py +181 -0
  106. package/hooks/promise-checker.sh +124 -0
  107. package/hooks/protect-source-files.sh +81 -0
  108. package/hooks/resume-context-loader.sh +53 -0
  109. package/hooks/startup-context-loader.sh +102 -0
  110. package/package.json +51 -0
  111. package/packages/cli-council/.github/workflows/claude-code-review.yml +44 -0
  112. package/packages/cli-council/.github/workflows/claude.yml +50 -0
  113. package/packages/cli-council/README.md +100 -0
  114. package/packages/cli-council/pyproject.toml +43 -0
  115. package/packages/cli-council/src/cli_council/__init__.py +19 -0
  116. package/packages/cli-council/src/cli_council/__main__.py +185 -0
  117. package/packages/cli-council/src/cli_council/backends/__init__.py +8 -0
  118. package/packages/cli-council/src/cli_council/backends/base.py +81 -0
  119. package/packages/cli-council/src/cli_council/backends/claude.py +25 -0
  120. package/packages/cli-council/src/cli_council/backends/codex.py +27 -0
  121. package/packages/cli-council/src/cli_council/backends/gemini.py +26 -0
  122. package/packages/cli-council/src/cli_council/checkpoint.py +212 -0
  123. package/packages/cli-council/src/cli_council/config.py +51 -0
  124. package/packages/cli-council/src/cli_council/council.py +391 -0
  125. package/packages/cli-council/src/cli_council/models.py +46 -0
  126. package/packages/llm-council/.github/workflows/claude-code-review.yml +44 -0
  127. package/packages/llm-council/.github/workflows/claude.yml +50 -0
  128. package/packages/llm-council/README.md +453 -0
  129. package/packages/llm-council/pyproject.toml +42 -0
  130. package/packages/llm-council/src/llm_council/__init__.py +23 -0
  131. package/packages/llm-council/src/llm_council/__main__.py +259 -0
  132. package/packages/llm-council/src/llm_council/checkpoint.py +193 -0
  133. package/packages/llm-council/src/llm_council/client.py +253 -0
  134. package/packages/llm-council/src/llm_council/config.py +232 -0
  135. package/packages/llm-council/src/llm_council/council.py +482 -0
  136. package/packages/llm-council/src/llm_council/models.py +46 -0
  137. package/packages/mcp-bibliography/MEMORY.md +31 -0
  138. package/packages/mcp-bibliography/_app.py +226 -0
  139. package/packages/mcp-bibliography/formatters.py +158 -0
  140. package/packages/mcp-bibliography/log/2026-03-13-2100.md +35 -0
  141. package/packages/mcp-bibliography/pyproject.toml +15 -0
  142. package/packages/mcp-bibliography/run.sh +20 -0
  143. package/packages/mcp-bibliography/scholarly_formatters.py +83 -0
  144. package/packages/mcp-bibliography/server.py +1857 -0
  145. package/packages/mcp-bibliography/tools/__init__.py +28 -0
  146. package/packages/mcp-bibliography/tools/_registry.py +19 -0
  147. package/packages/mcp-bibliography/tools/altmetric.py +107 -0
  148. package/packages/mcp-bibliography/tools/core.py +92 -0
  149. package/packages/mcp-bibliography/tools/dblp.py +52 -0
  150. package/packages/mcp-bibliography/tools/openalex.py +296 -0
  151. package/packages/mcp-bibliography/tools/opencitations.py +102 -0
  152. package/packages/mcp-bibliography/tools/openreview.py +179 -0
  153. package/packages/mcp-bibliography/tools/orcid.py +131 -0
  154. package/packages/mcp-bibliography/tools/scholarly.py +575 -0
  155. package/packages/mcp-bibliography/tools/unpaywall.py +63 -0
  156. package/packages/mcp-bibliography/tools/zenodo.py +123 -0
  157. package/packages/mcp-bibliography/uv.lock +711 -0
  158. package/scripts/setup.sh +143 -0
  159. package/skills/beamer-deck/SKILL.md +199 -0
  160. package/skills/beamer-deck/references/quality-rubric.md +54 -0
  161. package/skills/beamer-deck/references/review-prompts.md +106 -0
  162. package/skills/bib-validate/SKILL.md +261 -0
  163. package/skills/bib-validate/references/council-mode.md +34 -0
  164. package/skills/bib-validate/references/deep-verify.md +79 -0
  165. package/skills/bib-validate/references/fix-mode.md +36 -0
  166. package/skills/bib-validate/references/openalex-verification.md +45 -0
  167. package/skills/bib-validate/references/preprint-check.md +31 -0
  168. package/skills/bib-validate/references/ref-manager-crossref.md +41 -0
  169. package/skills/bib-validate/references/report-template.md +82 -0
  170. package/skills/code-archaeology/SKILL.md +141 -0
  171. package/skills/code-review/SKILL.md +265 -0
  172. package/skills/code-review/references/quality-rubric.md +67 -0
  173. package/skills/consolidate-memory/SKILL.md +208 -0
  174. package/skills/context-status/SKILL.md +126 -0
  175. package/skills/creation-guard/SKILL.md +230 -0
  176. package/skills/devils-advocate/SKILL.md +130 -0
  177. package/skills/devils-advocate/references/competing-hypotheses.md +83 -0
  178. package/skills/init-project/SKILL.md +115 -0
  179. package/skills/init-project-course/references/memory-and-settings.md +92 -0
  180. package/skills/init-project-course/references/organise-templates.md +94 -0
  181. package/skills/init-project-course/skill.md +147 -0
  182. package/skills/init-project-light/skill.md +139 -0
  183. package/skills/init-project-research/SKILL.md +368 -0
  184. package/skills/init-project-research/references/atlas-pipeline-sync.md +70 -0
  185. package/skills/init-project-research/references/atlas-schema.md +81 -0
  186. package/skills/init-project-research/references/confirmation-report.md +39 -0
  187. package/skills/init-project-research/references/domain-profile-template.md +104 -0
  188. package/skills/init-project-research/references/interview-round3.md +34 -0
  189. package/skills/init-project-research/references/literature-discovery.md +43 -0
  190. package/skills/init-project-research/references/scaffold-details.md +197 -0
  191. package/skills/init-project-research/templates/field-calibration.md +60 -0
  192. package/skills/init-project-research/templates/pipeline-manifest.md +63 -0
  193. package/skills/init-project-research/templates/run-all.sh +116 -0
  194. package/skills/init-project-research/templates/seed-files.md +337 -0
  195. package/skills/insights-deck/SKILL.md +151 -0
  196. package/skills/interview-me/SKILL.md +157 -0
  197. package/skills/latex/SKILL.md +141 -0
  198. package/skills/latex/references/latex-configs.md +183 -0
  199. package/skills/latex-autofix/SKILL.md +230 -0
  200. package/skills/latex-autofix/references/known-errors.md +183 -0
  201. package/skills/latex-autofix/references/quality-rubric.md +50 -0
  202. package/skills/latex-health-check/SKILL.md +161 -0
  203. package/skills/learn/SKILL.md +220 -0
  204. package/skills/learn/scripts/validate_skill.py +265 -0
  205. package/skills/lessons-learned/SKILL.md +201 -0
  206. package/skills/literature/SKILL.md +335 -0
  207. package/skills/literature/references/agent-templates.md +393 -0
  208. package/skills/literature/references/bibliometric-apis.md +44 -0
  209. package/skills/literature/references/cli-council-search.md +79 -0
  210. package/skills/literature/references/openalex-api-guide.md +371 -0
  211. package/skills/literature/references/openalex-common-queries.md +381 -0
  212. package/skills/literature/references/openalex-workflows.md +248 -0
  213. package/skills/literature/references/reference-manager-sync.md +36 -0
  214. package/skills/literature/references/scopus-api-guide.md +208 -0
  215. package/skills/literature/references/wos-api-guide.md +308 -0
  216. package/skills/multi-perspective/SKILL.md +311 -0
  217. package/skills/multi-perspective/references/computational-many-analysts.md +77 -0
  218. package/skills/pipeline-manifest/SKILL.md +226 -0
  219. package/skills/pre-submission-report/SKILL.md +153 -0
  220. package/skills/process-reviews/SKILL.md +244 -0
  221. package/skills/process-reviews/references/rr-routing.md +101 -0
  222. package/skills/project-deck/SKILL.md +87 -0
  223. package/skills/project-safety/SKILL.md +135 -0
  224. package/skills/proofread/SKILL.md +254 -0
  225. package/skills/proofread/references/quality-rubric.md +104 -0
  226. package/skills/python-env/SKILL.md +57 -0
  227. package/skills/quarto-deck/SKILL.md +226 -0
  228. package/skills/quarto-deck/references/markdown-format.md +143 -0
  229. package/skills/quarto-deck/references/quality-rubric.md +54 -0
  230. package/skills/save-context/SKILL.md +174 -0
  231. package/skills/session-log/SKILL.md +98 -0
  232. package/skills/shared/concept-validation-gate.md +161 -0
  233. package/skills/shared/council-protocol.md +265 -0
  234. package/skills/shared/distribution-diagnostics.md +164 -0
  235. package/skills/shared/engagement-stratified-sampling.md +218 -0
  236. package/skills/shared/escalation-protocol.md +74 -0
  237. package/skills/shared/external-audit-protocol.md +205 -0
  238. package/skills/shared/intercoder-reliability.md +256 -0
  239. package/skills/shared/mcp-degradation.md +81 -0
  240. package/skills/shared/method-probing-questions.md +163 -0
  241. package/skills/shared/multi-language-conventions.md +143 -0
  242. package/skills/shared/paid-api-safety.md +174 -0
  243. package/skills/shared/palettes.md +90 -0
  244. package/skills/shared/progressive-disclosure.md +92 -0
  245. package/skills/shared/project-documentation-content.md +443 -0
  246. package/skills/shared/project-documentation-format.md +281 -0
  247. package/skills/shared/project-documentation.md +100 -0
  248. package/skills/shared/publication-output.md +138 -0
  249. package/skills/shared/quality-scoring.md +70 -0
  250. package/skills/shared/reference-resolution.md +77 -0
  251. package/skills/shared/research-quality-rubric.md +165 -0
  252. package/skills/shared/rhetoric-principles.md +54 -0
  253. package/skills/shared/skill-design-patterns.md +272 -0
  254. package/skills/shared/skill-index.md +240 -0
  255. package/skills/shared/system-documentation.md +334 -0
  256. package/skills/shared/tikz-rules.md +402 -0
  257. package/skills/shared/validation-tiers.md +121 -0
  258. package/skills/shared/venue-guides/README.md +46 -0
  259. package/skills/shared/venue-guides/cell_press_style.md +483 -0
  260. package/skills/shared/venue-guides/conferences_formatting.md +564 -0
  261. package/skills/shared/venue-guides/cs_conference_style.md +463 -0
  262. package/skills/shared/venue-guides/examples/cell_summary_example.md +247 -0
  263. package/skills/shared/venue-guides/examples/medical_structured_abstract.md +313 -0
  264. package/skills/shared/venue-guides/examples/nature_abstract_examples.md +213 -0
  265. package/skills/shared/venue-guides/examples/neurips_introduction_example.md +245 -0
  266. package/skills/shared/venue-guides/journals_formatting.md +486 -0
  267. package/skills/shared/venue-guides/medical_journal_styles.md +535 -0
  268. package/skills/shared/venue-guides/ml_conference_style.md +556 -0
  269. package/skills/shared/venue-guides/nature_science_style.md +405 -0
  270. package/skills/shared/venue-guides/reviewer_expectations.md +417 -0
  271. package/skills/shared/venue-guides/venue_writing_styles.md +321 -0
  272. package/skills/split-pdf/SKILL.md +172 -0
  273. package/skills/split-pdf/methodology.md +48 -0
  274. package/skills/sync-notion/SKILL.md +93 -0
  275. package/skills/system-audit/SKILL.md +157 -0
  276. package/skills/system-audit/references/sub-agent-prompts.md +294 -0
  277. package/skills/task-management/SKILL.md +131 -0
  278. package/skills/update-focus/SKILL.md +204 -0
  279. package/skills/update-project-doc/SKILL.md +194 -0
  280. package/skills/validate-bib/SKILL.md +242 -0
  281. package/skills/validate-bib/references/council-mode.md +34 -0
  282. package/skills/validate-bib/references/deep-verify.md +71 -0
  283. package/skills/validate-bib/references/openalex-verification.md +45 -0
  284. package/skills/validate-bib/references/preprint-check.md +31 -0
  285. package/skills/validate-bib/references/report-template.md +62 -0
@@ -0,0 +1,208 @@
1
+ # Scopus API Guide (Elsevier REST API)
2
+
3
+ ## Base Information
4
+
5
+ **Base URL:** `https://api.elsevier.com/content/search/scopus`
6
+ **Authentication:** Two headers required:
7
+ - `X-ELS-APIKey` — Scopus API key
8
+ - `X-ELS-Insttoken` — Institutional token (enables access from any IP; omit for campus-only access)
9
+
10
+ **Rate Limits:** Varies by subscription. Typically 2-9 requests/second, throttled per API key.
11
+
12
+ ## Query Syntax
13
+
14
+ Scopus uses a field-qualified boolean query language.
15
+
16
+ ### Topic Search
17
+
18
+ ```
19
+ TITLE-ABS-KEY("machine learning" OR "deep learning")
20
+ ```
21
+
22
+ Searches title, abstract, and keywords. Space-separated terms within `TITLE-ABS-KEY()` are implicit AND. Use `OR` between quoted phrases for broader queries.
23
+
24
+ ### Subject Area Filter
25
+
26
+ ```
27
+ SUBJAREA(COMP)
28
+ ```
29
+
30
+ Filter by Scopus subject area codes. Common codes:
31
+ - `COMP` — Computer Science
32
+ - `BUSI` — Business, Management and Accounting
33
+ - `ECON` — Economics, Econometrics and Finance
34
+ - `DECI` — Decision Sciences
35
+ - `SOCI` — Social Sciences
36
+ - `PSYC` — Psychology
37
+ - `MATH` — Mathematics
38
+ - `ENGI` — Engineering
39
+
40
+ ### Year Filters
41
+
42
+ ```
43
+ PUBYEAR > 2019 -- published after 2019 (i.e. 2020+)
44
+ PUBYEAR < 2024 -- published before 2024
45
+ PUBYEAR = 2023 -- published in exactly 2023
46
+ ```
47
+
48
+ Note: these are strict inequalities. To get 2020-2023, use `PUBYEAR > 2019 AND PUBYEAR < 2024`.
49
+
50
+ ### Combining Filters
51
+
52
+ ```
53
+ TITLE-ABS-KEY("algorithmic collusion") AND PUBYEAR > 2019 AND PUBYEAR < 2026
54
+ ```
55
+
56
+ ### Author and Affiliation Queries
57
+
58
+ ```
59
+ AU-ID(12345678) -- author by Scopus ID
60
+ AFFIL("University of Example") -- affiliation search
61
+ AUTH("Smith J.") -- author name search
62
+ ```
63
+
64
+ ## Request Parameters
65
+
66
+ | Parameter | Description | Example |
67
+ |-----------|-------------|---------|
68
+ | `query` | Full Scopus query string | `TITLE-ABS-KEY("AI")` |
69
+ | `start` | Offset for pagination (0-indexed) | `0`, `25`, `50` |
70
+ | `count` | Results per page (max 25) | `25` |
71
+ | `sort` | Sort order | `relevancy`, `-citedby-count`, `-coverDate` |
72
+ | `view` | Response detail level | `STANDARD`, `COMPLETE` |
73
+ | `field` | Limit returned fields | `dc:title,dc:creator,prism:doi` |
74
+
75
+ ### Sort Options
76
+
77
+ | Value | Description |
78
+ |-------|-------------|
79
+ | `relevancy` | Relevance (default) |
80
+ | `-citedby-count` | Most cited first |
81
+ | `-coverDate` | Most recent first |
82
+ | `+coverDate` | Oldest first |
83
+ | `-pagecount` | Longest papers first |
84
+
85
+ ### View Options
86
+
87
+ | View | Fields included |
88
+ |------|----------------|
89
+ | `STANDARD` | Title, authors (first only), source, DOI |
90
+ | `COMPLETE` | All of STANDARD + abstract, all authors, keywords, citation count, EID |
91
+
92
+ **Always use `COMPLETE` view** to get abstracts, full author lists, and keywords.
93
+
94
+ ## Response Structure
95
+
96
+ ```json
97
+ {
98
+ "search-results": {
99
+ "opensearch:totalResults": "1234",
100
+ "opensearch:startIndex": "0",
101
+ "opensearch:itemsPerPage": "25",
102
+ "entry": [
103
+ {
104
+ "dc:title": "Paper Title",
105
+ "dc:creator": "First Author",
106
+ "author": [
107
+ {"authname": "Smith J.", "given-name": "John", "surname": "Smith"}
108
+ ],
109
+ "prism:publicationName": "Journal Name",
110
+ "prism:coverDate": "2024-01-15",
111
+ "prism:doi": "10.1000/example",
112
+ "citedby-count": "42",
113
+ "dc:description": "Abstract text...",
114
+ "authkeywords": "keyword1 | keyword2 | keyword3",
115
+ "eid": "2-s2.0-85012345678"
116
+ }
117
+ ]
118
+ }
119
+ }
120
+ ```
121
+
122
+ ### Key Response Fields
123
+
124
+ | Field | Description |
125
+ |-------|-------------|
126
+ | `dc:title` | Paper title |
127
+ | `dc:creator` | First author only |
128
+ | `author` | Full author list (array of objects with `authname`, `given-name`, `surname`) |
129
+ | `prism:publicationName` | Journal/conference name |
130
+ | `prism:coverDate` | Publication date (YYYY-MM-DD) |
131
+ | `prism:doi` | DOI (without `https://doi.org/` prefix) |
132
+ | `citedby-count` | Citation count (string) |
133
+ | `dc:description` | Abstract (COMPLETE view only) |
134
+ | `authkeywords` | Author keywords, pipe-separated |
135
+ | `eid` | Scopus Electronic ID (e.g., `2-s2.0-85012345678`) |
136
+
137
+ ## Pagination
138
+
139
+ Scopus uses offset-based pagination:
140
+
141
+ ```
142
+ Page 1: start=0, count=25
143
+ Page 2: start=25, count=25
144
+ Page 3: start=50, count=25
145
+ ```
146
+
147
+ Check `opensearch:totalResults` to know when to stop. Maximum 25 results per page.
148
+
149
+ ### Detecting Empty Results
150
+
151
+ An entry with an `error` key means no results:
152
+ ```json
153
+ {"entry": [{"error": "Result set was empty"}]}
154
+ ```
155
+
156
+ ## Common Query Patterns
157
+
158
+ ### Highly Cited Papers on a Topic
159
+
160
+ ```
161
+ query: TITLE-ABS-KEY("platform governance") AND PUBYEAR > 2019
162
+ sort: -citedby-count
163
+ count: 25
164
+ view: COMPLETE
165
+ ```
166
+
167
+ ### Recent Papers in a Subject Area
168
+
169
+ ```
170
+ query: SUBJAREA(BUSI) AND TITLE-ABS-KEY("artificial intelligence") AND PUBYEAR > 2022
171
+ sort: -coverDate
172
+ count: 25
173
+ view: COMPLETE
174
+ ```
175
+
176
+ ### Year-by-Year Trend Counts
177
+
178
+ Run one query per year with `count=1` and read `opensearch:totalResults`:
179
+ ```
180
+ query: TITLE-ABS-KEY("algorithmic collusion") AND PUBYEAR = 2023
181
+ count: 1
182
+ ```
183
+
184
+ ## Error Handling
185
+
186
+ ### HTTP Status Codes
187
+
188
+ - `200` — Success
189
+ - `400` — Bad query syntax (check parentheses, field names)
190
+ - `401` — Invalid API key
191
+ - `403` — Rate limit exceeded or insufficient permissions
192
+ - `404` — Resource not found
193
+ - `429` — Too many requests (back off)
194
+
195
+ ### Common Pitfalls
196
+
197
+ 1. **Max 25 results per page** — unlike OpenAlex (200), Scopus pagination is slow
198
+ 2. **Year filters are strict inequalities** — `PUBYEAR > 2019` means 2020+, not 2019+
199
+ 3. **`dc:creator` is first author only** — use the `author` array for full author list
200
+ 4. **Keywords are pipe-separated** — split on `|`, not comma
201
+ 5. **DOI field lacks prefix** — `prism:doi` returns `10.1000/example`, not `https://doi.org/10.1000/example`
202
+ 6. **InstToken is required for off-campus access** — without it, requests from non-institutional IPs will fail
203
+
204
+ ## Additional Resources
205
+
206
+ - Scopus Search API docs: https://dev.elsevier.com/documentation/ScopusSearchAPI.wadl
207
+ - Query syntax guide: https://dev.elsevier.com/sc_search_tips.html
208
+ - Subject area codes: https://service.elsevier.com/app/answers/detail/a_id/15181
@@ -0,0 +1,308 @@
1
+ # Web of Science API Guide
2
+
3
+ ## Overview
4
+
5
+ WoS offers two API tiers with different endpoints, pagination, and response formats. Set via `WOS_API_TIER` env var (default: `starter`).
6
+
7
+ | Feature | Starter API | Expanded API |
8
+ |---------|-------------|--------------|
9
+ | Base URL | `https://api.clarivate.com/apis/wos-starter/v1` | `https://wos-api.clarivate.com/api/wos` |
10
+ | Search endpoint | `/documents` | Root (`/`) |
11
+ | Results per page | Max 50 | Max 100 |
12
+ | Pagination | Page-based (`page=N`) | Record-based (`firstRecord=N`) |
13
+ | Abstracts | Not included | Included |
14
+ | Response format | Flat JSON | Deeply nested XML-like JSON |
15
+
16
+ **Authentication:** `X-ApiKey` header for both tiers.
17
+
18
+ ## Query Syntax
19
+
20
+ ### Topic Search
21
+
22
+ ```
23
+ TS=(machine learning)
24
+ TS=("algorithmic collusion" OR "tacit collusion")
25
+ ```
26
+
27
+ `TS=()` searches title, abstract, author keywords, and Keywords Plus.
28
+
29
+ ### Year Filter
30
+
31
+ ```
32
+ PY=(2020-2024) -- range (inclusive)
33
+ PY=(2023) -- single year
34
+ ```
35
+
36
+ ### Combining
37
+
38
+ ```
39
+ TS=("platform governance") AND PY=(2020-2025)
40
+ ```
41
+
42
+ ### Other Field Tags
43
+
44
+ | Tag | Description | Example |
45
+ |-----|-------------|---------|
46
+ | `TS=()` | Topic (title + abstract + keywords) | `TS=("deep learning")` |
47
+ | `TI=()` | Title only | `TI=("neural network")` |
48
+ | `AU=()` | Author | `AU=(Smith J)` |
49
+ | `SO=()` | Source (journal name) | `SO=("Management Science")` |
50
+ | `OG=()` | Organisation | `OG=("University of Example")` |
51
+ | `DO=()` | DOI | `DO=(10.1000/example)` |
52
+ | `PY=()` | Publication year | `PY=(2020-2024)` |
53
+
54
+ ## Starter API
55
+
56
+ ### Request Parameters
57
+
58
+ | Parameter | Description | Example |
59
+ |-----------|-------------|---------|
60
+ | `q` | WoS query string | `TS=("AI") AND PY=(2023)` |
61
+ | `limit` | Results per page (max 50) | `50` |
62
+ | `page` | Page number (1-indexed) | `1` |
63
+ | `sortField` | Sort order | `relevance`, `TC.D`, `PY.D` |
64
+ | `db` | Database | `WOS` |
65
+
66
+ ### Sort Options (Starter)
67
+
68
+ | Value | Description |
69
+ |-------|-------------|
70
+ | `relevance` | Relevance (default) |
71
+ | `TC.D` | Times Cited descending |
72
+ | `PY.D` | Publication Year descending |
73
+ | `PY.A` | Publication Year ascending |
74
+
75
+ ### Response Structure
76
+
77
+ ```json
78
+ {
79
+ "metadata": {
80
+ "total": 1234,
81
+ "page": 1,
82
+ "limit": 50
83
+ },
84
+ "hits": [
85
+ {
86
+ "uid": "WOS:000123456789",
87
+ "title": "Paper Title",
88
+ "names": {
89
+ "authors": [
90
+ {"displayName": "Smith, John", "wosStandard": "Smith, J"}
91
+ ]
92
+ },
93
+ "source": {
94
+ "sourceTitle": "Journal Name",
95
+ "publishYear": 2024
96
+ },
97
+ "identifiers": {
98
+ "doi": "10.1000/example"
99
+ },
100
+ "keywords": {
101
+ "authorKeywords": ["keyword1", "keyword2"]
102
+ },
103
+ "citations": [
104
+ {"db": "wos", "count": 42}
105
+ ]
106
+ }
107
+ ]
108
+ }
109
+ ```
110
+
111
+ ### Key Response Fields (Starter)
112
+
113
+ | Path | Description |
114
+ |------|-------------|
115
+ | `uid` | WoS accession number (e.g., `WOS:000123456789`) |
116
+ | `title` | Paper title |
117
+ | `names.authors[].displayName` | Author display name |
118
+ | `source.sourceTitle` | Journal/conference name |
119
+ | `source.publishYear` | Publication year |
120
+ | `identifiers.doi` | DOI (without prefix) |
121
+ | `keywords.authorKeywords` | Author keywords (array) |
122
+ | `citations[].count` | Citation count (filter by `db: "wos"`) |
123
+
124
+ **Note:** Starter API does **not** return abstracts.
125
+
126
+ ### Pagination (Starter)
127
+
128
+ ```
129
+ Page 1: page=1, limit=50
130
+ Page 2: page=2, limit=50
131
+ ```
132
+
133
+ Stop when `page * limit >= metadata.total`.
134
+
135
+ ## Expanded API
136
+
137
+ ### Request Parameters
138
+
139
+ | Parameter | Description | Example |
140
+ |-----------|-------------|---------|
141
+ | `databaseId` | Database | `WOS` |
142
+ | `usrQuery` | WoS query string | `TS=("AI") AND PY=(2023)` |
143
+ | `count` | Results per page (max 100) | `100` |
144
+ | `firstRecord` | Starting record (1-indexed) | `1` |
145
+ | `sortField` | Sort order | `RS+D`, `TC+D`, `PY+D` |
146
+ | `optionView` | Response detail level | `FR` (full record) |
147
+
148
+ ### Sort Options (Expanded)
149
+
150
+ | Value | Description |
151
+ |-------|-------------|
152
+ | `RS+D` | Relevance Score descending (default) |
153
+ | `TC+D` | Times Cited descending |
154
+ | `PY+D` | Publication Year descending |
155
+ | `PY+A` | Publication Year ascending |
156
+
157
+ ### Response Structure
158
+
159
+ The Expanded API returns deeply nested JSON. Records are at:
160
+ ```
161
+ data.Data.Records.records.REC
162
+ ```
163
+
164
+ Each `REC` is a single record:
165
+
166
+ ```json
167
+ {
168
+ "UID": "WOS:000123456789",
169
+ "static_data": {
170
+ "summary": {
171
+ "titles": {
172
+ "title": [
173
+ {"type": "item", "content": "Paper Title"},
174
+ {"type": "source", "content": "Journal Name"}
175
+ ]
176
+ },
177
+ "names": {
178
+ "name": [
179
+ {"role": "author", "display_name": "Smith, John", "full_name": "Smith, John"}
180
+ ]
181
+ },
182
+ "pub_info": {
183
+ "pubyear": "2024"
184
+ }
185
+ },
186
+ "fullrecord_metadata": {
187
+ "keywords": {
188
+ "keyword": ["keyword1", "keyword2"]
189
+ },
190
+ "abstracts": {
191
+ "abstract": {
192
+ "abstract_text": {
193
+ "p": "Abstract text here..."
194
+ }
195
+ }
196
+ }
197
+ }
198
+ },
199
+ "dynamic_data": {
200
+ "citation_related": {
201
+ "tc_list": {
202
+ "silo_tc": [
203
+ {"coll_id": "WOS", "local_count": "42"}
204
+ ]
205
+ }
206
+ },
207
+ "cluster_related": {
208
+ "identifiers": {
209
+ "identifier": [
210
+ {"type": "doi", "value": "10.1000/example"}
211
+ ]
212
+ }
213
+ }
214
+ }
215
+ }
216
+ ```
217
+
218
+ ### Key Paths (Expanded)
219
+
220
+ | Path | Description |
221
+ |------|-------------|
222
+ | `UID` | WoS accession number |
223
+ | `static_data.summary.titles.title` | Array; `type: "item"` = title, `type: "source"` = journal |
224
+ | `static_data.summary.names.name` | Author list; filter by `role: "author"` |
225
+ | `static_data.summary.pub_info.pubyear` | Publication year |
226
+ | `static_data.fullrecord_metadata.keywords.keyword` | Keywords |
227
+ | `static_data.fullrecord_metadata.abstracts.abstract.abstract_text.p` | Abstract (string or array of paragraphs) |
228
+ | `dynamic_data.citation_related.tc_list.silo_tc` | Citation counts; filter by `coll_id: "WOS"` |
229
+ | `dynamic_data.cluster_related.identifiers.identifier` | DOI; filter by `type: "doi"` |
230
+
231
+ **Warning:** Many of these fields can be either a single object or an array. Always normalise to array before iterating.
232
+
233
+ ### QueryID for Subsequent Pages
234
+
235
+ The first request returns a `QueryID` in `QueryResult`:
236
+ ```json
237
+ {"QueryResult": {"QueryID": 12345, "RecordsFound": 500}}
238
+ ```
239
+
240
+ Use it for subsequent pages:
241
+ ```
242
+ GET /query/12345?count=100&firstRecord=101&sortField=RS+D&optionView=FR
243
+ ```
244
+
245
+ ### Pagination (Expanded)
246
+
247
+ ```
248
+ Request 1: firstRecord=1, count=100
249
+ Request 2: firstRecord=101, count=100 (use QueryID)
250
+ Request 3: firstRecord=201, count=100 (use QueryID)
251
+ ```
252
+
253
+ Stop when `firstRecord > RecordsFound`.
254
+
255
+ ## Common Query Patterns
256
+
257
+ ### Highly Cited Papers on a Topic
258
+
259
+ ```
260
+ q: TS=("platform governance") AND PY=(2020-2025)
261
+ sortField: TC.D (Starter) / TC+D (Expanded)
262
+ limit: 50
263
+ ```
264
+
265
+ ### Year-by-Year Trend Counts
266
+
267
+ Run one query per year with `limit=1` (Starter) or `count=0` (Expanded) and read the total:
268
+
269
+ **Starter:**
270
+ ```
271
+ q: TS=("algorithmic collusion") AND PY=(2023)
272
+ limit: 1
273
+ → metadata.total
274
+ ```
275
+
276
+ **Expanded:**
277
+ ```
278
+ usrQuery: TS=("algorithmic collusion") AND PY=(2023)
279
+ count: 0
280
+ firstRecord: 1
281
+ → QueryResult.RecordsFound
282
+ ```
283
+
284
+ ## Error Handling
285
+
286
+ ### HTTP Status Codes
287
+
288
+ - `200` — Success
289
+ - `400` — Bad query syntax
290
+ - `401` — Invalid API key
291
+ - `403` — Forbidden (check subscription tier)
292
+ - `404` — Not found
293
+ - `429` — Rate limit exceeded
294
+
295
+ ### Common Pitfalls
296
+
297
+ 1. **Starter has no abstracts** — switch to Expanded tier if abstracts are needed
298
+ 2. **Expanded response is deeply nested** — `Data.Records.records.REC` can be a single object or array
299
+ 3. **Single-element arrays collapse** — `names.name` may be `{}` instead of `[{}]` when only one author
300
+ 4. **DOI can be in multiple locations** — check `dynamic_data.cluster_related.identifiers`, then `static_data.summary.identifiers`, then `static_data.item.ids`
301
+ 5. **Sort field syntax differs** — Starter uses `.` separator (`TC.D`), Expanded uses `+` (`TC+D`)
302
+ 6. **QueryID is only for Expanded** — Starter uses standard page-based pagination
303
+
304
+ ## Additional Resources
305
+
306
+ - WoS Starter API docs: https://developer.clarivate.com/apis/wos-starter
307
+ - WoS Expanded API docs: https://developer.clarivate.com/apis/wos
308
+ - Query language reference: https://images.webofknowledge.com/images/help/WOS/hs_search_rules.html