-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_semantic_scholar.py
More file actions
34 lines (28 loc) · 938 Bytes
/
test_semantic_scholar.py
File metadata and controls
34 lines (28 loc) · 938 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
"""Test different ways to query Semantic Scholar API."""
print("🧪 Testing Semantic Scholar API with different formats...")
print("=" * 70)
from semanticscholar import SemanticScholar
sch = SemanticScholar()
paper_id = "1706.03762"
# Test different formats
formats = [
("arXiv ID", f"arXiv:{paper_id}"),
("ArXiv ID", f"ArXiv:{paper_id}"),
("ARXIV ID", f"ARXIV:{paper_id}"),
("DOI format", f"DOI:10.48550/arXiv.{paper_id}"),
("Plain arXiv", paper_id),
("URL format", f"https://arxiv.org/abs/{paper_id}"),
]
for label, query in formats:
print(f"\n{label}: {query}")
try:
paper = sch.get_paper(query)
if paper:
print(f" ✅ Found: {paper.title}")
print(f" 📊 Citations: {paper.citationCount}")
else:
print(" ❌ Not found")
except Exception as e:
print(f" ❌ Error: {e}")
print("\n" + "=" * 70)