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,371 @@
1
+ # OpenAlex API Complete Guide
2
+
3
+ ## Base Information
4
+
5
+ **Base URL:** `https://api.openalex.org`
6
+ **Authentication:** None required
7
+ **Rate Limits:**
8
+ - Default: 1 request/second, 100k requests/day
9
+ - Polite pool (with email): 10 requests/second, 100k requests/day
10
+
11
+ ## Critical Best Practices
12
+
13
+ ### ✅ DO: Use `?sample` parameter for random sampling
14
+ ```
15
+ https://api.openalex.org/works?sample=20&seed=123
16
+ ```
17
+ For large samples (10k+), use multiple seeds and deduplicate.
18
+
19
+ ### ❌ DON'T: Use random page numbers for sampling
20
+ Incorrect: `?page=5`, `?page=17` - This biases results!
21
+
22
+ ### ✅ DO: Use two-step lookup for entity filtering
23
+ ```
24
+ 1. Find entity ID: /authors?search=einstein
25
+ 2. Use ID: /works?filter=authorships.author.id:A5023888391
26
+ ```
27
+
28
+ ### ❌ DON'T: Filter by entity names directly
29
+ Incorrect: `/works?filter=author_name:Einstein` - Names are ambiguous!
30
+
31
+ ### ✅ DO: Use maximum page size for bulk extraction
32
+ ```
33
+ ?per-page=200
34
+ ```
35
+ This is 8x faster than default (25).
36
+
37
+ ### ❌ DON'T: Use default page sizes
38
+ Default is only 25 results per page.
39
+
40
+ ### ✅ DO: Use OR filter (pipe |) for batch lookups
41
+ ```
42
+ /works?filter=doi:10.1/abc|10.2/def|10.3/ghi
43
+ ```
44
+ Up to 50 values per filter.
45
+
46
+ ### ❌ DON'T: Make sequential API calls for lists
47
+ Making 100 separate calls when you can batch them is inefficient.
48
+
49
+ ### ✅ DO: Implement exponential backoff for retries
50
+ ```python
51
+ for attempt in range(max_retries):
52
+ try:
53
+ response = requests.get(url)
54
+ if response.status_code == 200:
55
+ return response.json()
56
+ except:
57
+ wait_time = 2 ** attempt
58
+ time.sleep(wait_time)
59
+ ```
60
+
61
+ ### ✅ DO: Add email for 10x rate limit boost
62
+ ```
63
+ ?mailto=yourname@example.edu
64
+ ```
65
+ Increases from 1 req/sec → 10 req/sec.
66
+
67
+ ## Entity Endpoints
68
+
69
+ - `/works` - 240M+ scholarly documents
70
+ - `/authors` - Researcher profiles
71
+ - `/sources` - Journals, repositories, conferences
72
+ - `/institutions` - Universities, research organizations
73
+ - `/topics` - Subject classifications (3-level hierarchy)
74
+ - `/publishers` - Publishing organizations
75
+ - `/funders` - Funding agencies
76
+ - `/text` - Tag your own text with topics/keywords (POST)
77
+
78
+ ## Essential Query Parameters
79
+
80
+ | Parameter | Description | Example |
81
+ |-----------|-------------|---------|
82
+ | `filter=` | Filter results | `?filter=publication_year:2020` |
83
+ | `search=` | Full-text search | `?search=machine+learning` |
84
+ | `sort=` | Sort results | `?sort=cited_by_count:desc` |
85
+ | `per-page=` | Results per page (max 200) | `?per-page=200` |
86
+ | `page=` | Page number | `?page=2` |
87
+ | `sample=` | Random results | `?sample=50&seed=42` |
88
+ | `select=` | Limit fields | `?select=id,title` |
89
+ | `group_by=` | Aggregate by field | `?group_by=publication_year` |
90
+ | `mailto=` | Email for polite pool | `?mailto=you@example.edu` |
91
+
92
+ ## Filter Syntax
93
+
94
+ ### Basic Filtering
95
+ ```
96
+ Single filter: ?filter=publication_year:2020
97
+ Multiple (AND): ?filter=publication_year:2020,is_oa:true
98
+ Values (OR): ?filter=type:journal-article|book
99
+ Negation: ?filter=type:!journal-article
100
+ ```
101
+
102
+ ### Comparison Operators
103
+ ```
104
+ Greater than: ?filter=cited_by_count:>100
105
+ Less than: ?filter=publication_year:<2020
106
+ Range: ?filter=publication_year:2020-2023
107
+ ```
108
+
109
+ ### Multiple Values in Same Attribute
110
+ ```
111
+ Repeat filter: ?filter=institutions.country_code:us,institutions.country_code:gb
112
+ Use + symbol: ?filter=institutions.country_code:us+gb
113
+ ```
114
+ Both mean: "works with author from US AND author from GB"
115
+
116
+ ### OR Queries
117
+ ```
118
+ Any of these: ?filter=institutions.country_code:us|gb|ca
119
+ Batch IDs: ?filter=doi:10.1/abc|10.2/def
120
+ ```
121
+ Up to 50 values with pipes.
122
+
123
+ ## Common Query Patterns
124
+
125
+ ### Get Random Sample
126
+ ```bash
127
+ # Small sample
128
+ https://api.openalex.org/works?sample=20&seed=42
129
+
130
+ # Large sample (10k+) - make multiple requests
131
+ https://api.openalex.org/works?sample=1000&seed=1
132
+ https://api.openalex.org/works?sample=1000&seed=2
133
+ # Then deduplicate by ID
134
+ ```
135
+
136
+ ### Search Works
137
+ ```bash
138
+ # Simple search
139
+ https://api.openalex.org/works?search=machine+learning
140
+
141
+ # Search specific field
142
+ https://api.openalex.org/works?filter=title.search:CRISPR
143
+
144
+ # Search + filter
145
+ https://api.openalex.org/works?search=climate&filter=publication_year:2023
146
+ ```
147
+
148
+ ### Find Works by Author (Two-Step)
149
+ ```bash
150
+ # Step 1: Get author ID
151
+ https://api.openalex.org/authors?search=Heather+Piwowar
152
+ # Returns: "id": "https://openalex.org/A5023888391"
153
+
154
+ # Step 2: Get their works
155
+ https://api.openalex.org/works?filter=authorships.author.id:A5023888391
156
+ ```
157
+
158
+ ### Find Works by Institution (Two-Step)
159
+ ```bash
160
+ # Step 1: Get institution ID
161
+ https://api.openalex.org/institutions?search=MIT
162
+ # Returns: "id": "https://openalex.org/I136199984"
163
+
164
+ # Step 2: Get their works
165
+ https://api.openalex.org/works?filter=authorships.institutions.id:I136199984
166
+ ```
167
+
168
+ ### Highly Cited Recent Papers
169
+ ```bash
170
+ https://api.openalex.org/works?filter=publication_year:>2020&sort=cited_by_count:desc&per-page=200
171
+ ```
172
+
173
+ ### Open Access Works
174
+ ```bash
175
+ # All OA
176
+ https://api.openalex.org/works?filter=is_oa:true
177
+
178
+ # Gold OA only
179
+ https://api.openalex.org/works?filter=open_access.oa_status:gold
180
+ ```
181
+
182
+ ### Multiple Criteria
183
+ ```bash
184
+ # Recent OA works about COVID from top institutions
185
+ https://api.openalex.org/works?filter=publication_year:2022,is_oa:true,title.search:covid,authorships.institutions.id:I136199984|I27837315
186
+ ```
187
+
188
+ ### Bulk DOI Lookup
189
+ ```bash
190
+ # Get specific works by DOI (up to 50 per request)
191
+ https://api.openalex.org/works?filter=doi:https://doi.org/10.1371/journal.pone.0266781|https://doi.org/10.1371/journal.pone.0267149&per-page=50
192
+ ```
193
+
194
+ ### Aggregate Data
195
+ ```bash
196
+ # Top topics
197
+ https://api.openalex.org/works?group_by=topics.id
198
+
199
+ # Papers per year
200
+ https://api.openalex.org/works?group_by=publication_year
201
+
202
+ # Most prolific institutions
203
+ https://api.openalex.org/works?group_by=authorships.institutions.id
204
+ ```
205
+
206
+ ### Pagination
207
+ ```bash
208
+ # First page
209
+ https://api.openalex.org/works?filter=publication_year:2023&per-page=200
210
+
211
+ # Next pages
212
+ https://api.openalex.org/works?filter=publication_year:2023&per-page=200&page=2
213
+ ```
214
+
215
+ ## Response Structure
216
+
217
+ ### List Endpoints
218
+ ```json
219
+ {
220
+ "meta": {
221
+ "count": 240523418,
222
+ "db_response_time_ms": 42,
223
+ "page": 1,
224
+ "per_page": 25
225
+ },
226
+ "results": [
227
+ { /* entity object */ }
228
+ ]
229
+ }
230
+ ```
231
+
232
+ ### Single Entity
233
+ ```
234
+ https://api.openalex.org/works/W2741809807
235
+ → Returns Work object directly (no meta/results wrapper)
236
+ ```
237
+
238
+ ### Group By
239
+ ```json
240
+ {
241
+ "meta": { "count": 100 },
242
+ "group_by": [
243
+ {
244
+ "key": "https://openalex.org/T10001",
245
+ "key_display_name": "Artificial Intelligence",
246
+ "count": 15234
247
+ }
248
+ ]
249
+ }
250
+ ```
251
+
252
+ ## Works Filters (Most Common)
253
+
254
+ | Filter | Description | Example |
255
+ |--------|-------------|---------|
256
+ | `authorships.author.id` | Author's OpenAlex ID | `A5023888391` |
257
+ | `authorships.institutions.id` | Institution's ID | `I136199984` |
258
+ | `cited_by_count` | Citation count | `>100` |
259
+ | `is_oa` | Is open access | `true/false` |
260
+ | `publication_year` | Year published | `2020`, `>2020`, `2018-2022` |
261
+ | `primary_location.source.id` | Source (journal) ID | `S137773608` |
262
+ | `topics.id` | Topic ID | `T10001` |
263
+ | `type` | Document type | `article`, `book`, `dataset` |
264
+ | `has_doi` | Has DOI | `true/false` |
265
+ | `has_fulltext` | Has fulltext | `true/false` |
266
+
267
+ ## Authors Filters
268
+
269
+ | Filter | Description |
270
+ |--------|-------------|
271
+ | `last_known_institution.id` | Current/last institution |
272
+ | `works_count` | Number of works |
273
+ | `cited_by_count` | Total citations |
274
+ | `orcid` | ORCID identifier |
275
+
276
+ ## External ID Support
277
+
278
+ ### Works
279
+ ```
280
+ DOI: /works/https://doi.org/10.7717/peerj.4375
281
+ PMID: /works/pmid:29844763
282
+ ```
283
+
284
+ ### Authors
285
+ ```
286
+ ORCID: /authors/https://orcid.org/0000-0003-1613-5981
287
+ ```
288
+
289
+ ### Institutions
290
+ ```
291
+ ROR: /institutions/https://ror.org/02y3ad647
292
+ ```
293
+
294
+ ### Sources
295
+ ```
296
+ ISSN: /sources/issn:0028-0836
297
+ ```
298
+
299
+ ## Performance Tips
300
+
301
+ 1. **Use maximum page size**: `?per-page=200` (8x fewer calls)
302
+ 2. **Batch ID lookups**: Use pipe operator for up to 50 IDs
303
+ 3. **Select only needed fields**: `?select=id,title,publication_year`
304
+ 4. **Use concurrent requests**: With rate limiting (10 req/sec with email)
305
+ 5. **Add email**: `?mailto=you@example.edu` for 10x speed boost
306
+
307
+ ## Error Handling
308
+
309
+ ### HTTP Status Codes
310
+ - `200` - Success
311
+ - `400` - Bad request (check filter syntax)
312
+ - `403` - Rate limit exceeded (implement backoff)
313
+ - `404` - Entity doesn't exist
314
+ - `500` - Server error (retry with backoff)
315
+
316
+ ### Exponential Backoff
317
+ ```python
318
+ def fetch_with_retry(url, max_retries=5):
319
+ for attempt in range(max_retries):
320
+ try:
321
+ response = requests.get(url, timeout=30)
322
+ if response.status_code == 200:
323
+ return response.json()
324
+ elif response.status_code in [403, 500, 502, 503, 504]:
325
+ wait_time = 2 ** attempt
326
+ time.sleep(wait_time)
327
+ else:
328
+ response.raise_for_status()
329
+ except requests.exceptions.Timeout:
330
+ if attempt < max_retries - 1:
331
+ time.sleep(2 ** attempt)
332
+ else:
333
+ raise
334
+ raise Exception(f"Failed after {max_retries} retries")
335
+ ```
336
+
337
+ ## Rate Limiting
338
+
339
+ ### Without Email (Default Pool)
340
+ - 1 request/second
341
+ - 100,000 requests/day
342
+
343
+ ### With Email (Polite Pool)
344
+ - 10 requests/second
345
+ - 100,000 requests/day
346
+ - **Always use for production**
347
+
348
+ ### Concurrent Request Strategy
349
+ 1. Track requests per second globally
350
+ 2. Use semaphore or rate limiter across threads
351
+ 3. Monitor for 403 responses
352
+ 4. Back off if limits hit
353
+
354
+ ## Common Mistakes to Avoid
355
+
356
+ 1. ❌ Using page numbers for sampling → ✅ Use `?sample=`
357
+ 2. ❌ Filtering by entity names → ✅ Get IDs first
358
+ 3. ❌ Default page size → ✅ Use `per-page=200`
359
+ 4. ❌ Sequential ID lookups → ✅ Batch with pipe operator
360
+ 5. ❌ No error handling → ✅ Implement retry with backoff
361
+ 6. ❌ Ignoring rate limits → ✅ Global rate limiting
362
+ 7. ❌ Not including email → ✅ Add `mailto=`
363
+ 8. ❌ Fetching all fields → ✅ Use `select=`
364
+
365
+ ## Additional Resources
366
+
367
+ - Full documentation: https://docs.openalex.org
368
+ - API Overview: https://docs.openalex.org/how-to-use-the-api/api-overview
369
+ - Entity schemas: https://docs.openalex.org/api-entities
370
+ - Help: https://openalex.org/help
371
+ - User group: https://groups.google.com/g/openalex-users