-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.php
More file actions
1098 lines (1021 loc) · 50.5 KB
/
Copy pathindex.php
File metadata and controls
1098 lines (1021 loc) · 50.5 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>peviitor API — Documentation</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Inter', -apple-system, sans-serif;
background: linear-gradient(135deg, #fdf6f0 0%, #f5e6d3 50%, #f0dcc8 100%);
color: #2d2a24;
min-height: 100vh;
line-height: 1.6;
}
.container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
/* Header */
header {
text-align: center;
padding: 2rem 0 2rem;
position: relative;
}
.logo-link {
display: inline-block;
line-height: 0;
}
.logo-img {
height: 32px;
width: auto;
transition: opacity 0.2s;
}
.logo-img:hover { opacity: 0.8; }
header h1 {
font-size: 1.6rem;
font-weight: 700;
color: #c44536;
letter-spacing: -0.02em;
margin: 0;
}
header p {
color: #7d6b5a;
font-size: 0.95rem;
margin-top: 0.4rem;
}
header .base-url {
display: inline-block;
margin-top: 0.6rem;
padding: 0.4rem 1rem;
background: #e8d5c4;
border-radius: 8px;
font-family: 'Fira Code', monospace;
font-size: 0.85rem;
color: #5a4a3a;
}
/* Lang toggle */
.lang-toggle {
position: absolute;
top: 0;
right: 0;
display: inline-flex;
background: #e8d5c4;
border-radius: 8px;
overflow: hidden;
}
.lang-toggle button {
border: none;
background: transparent;
padding: 0.35rem 0.75rem;
font-family: 'Inter', sans-serif;
font-size: 0.8rem;
font-weight: 600;
color: #7d6b5a;
cursor: pointer;
transition: all 0.2s;
}
.lang-toggle button.active {
background: #c44536;
color: #fff;
}
.lang-toggle button:not(.active):hover { color: #5a4a3a; }
.test-badge-link {
display: inline-block;
margin-top: 0.6rem;
text-decoration: none;
}
.test-badge {
display: inline-flex;
align-items: center;
gap: 0.3rem;
font-size: 0.75rem;
font-weight: 600;
padding: 0.3rem 0.75rem;
border-radius: 8px;
background: #2d2a24;
color: #f4e9d8;
transition: opacity 0.2s;
}
.test-badge:hover { opacity: 0.8; }
/* Card */
.card {
background: #fffcf9;
border-radius: 16px;
box-shadow: 0 4px 24px rgba(90, 60, 40, 0.10);
overflow: hidden;
margin-bottom: 1.5rem;
}
.card-header {
padding: 1.25rem 1.5rem;
border-bottom: 1px solid #f0e4d8;
font-weight: 600;
font-size: 0.95rem;
color: #5a4a3a;
display: flex;
align-items: center;
gap: 0.5rem;
}
.card-body { padding: 1.5rem; }
/* Endpoint row */
.endpoint-row {
display: flex;
align-items: center;
gap: 1rem;
padding: 1.25rem 1.5rem;
background: linear-gradient(135deg, #f0faf3, #e8f5ec);
border-bottom: 1px solid #d4e8db;
cursor: pointer;
user-select: none;
transition: background 0.2s;
}
.endpoint-row:hover { opacity: 0.92; }
.toggle-arrow {
font-size: 0.75rem;
color: #7d6b5a;
transition: transform 0.25s ease;
margin-left: auto;
}
.toggle-arrow.open { transform: rotate(90deg); }
.endpoint-content { overflow: hidden; }
.method-badge {
display: inline-flex;
align-items: center;
justify-content: center;
font-family: 'Fira Code', monospace;
font-weight: 700;
font-size: 0.8rem;
padding: 0.3rem 0.7rem;
border-radius: 6px;
text-transform: uppercase;
letter-spacing: 0.03em;
min-width: 52px;
background: #2e7d32;
color: #fff;
box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
}
.endpoint-path {
font-family: 'Fira Code', monospace;
font-size: 1rem;
font-weight: 500;
color: #1b5e20;
}
.endpoint-desc {
font-size: 0.85rem;
color: #4a7c5a;
}
/* DELETE badge variant */
.method-badge-delete {
background: #c62828;
box-shadow: 0 2px 6px rgba(198, 40, 40, 0.3);
}
.endpoint-row-delete {
background: linear-gradient(135deg, #fef0f0, #fce4e4);
border-bottom: 1px solid #f5cdcd;
cursor: pointer;
user-select: none;
}
.endpoint-row-delete:hover { opacity: 0.92; }
.endpoint-row-delete .endpoint-path { color: #b71c1c; }
.endpoint-row-delete .endpoint-desc { color: #b55a5a; }
/* Warning banner */
.warning-banner {
background: #fff3e0;
border-left: 4px solid #e65100;
padding: 0.75rem 1rem;
border-radius: 6px;
margin-bottom: 1rem;
font-size: 0.85rem;
color: #bf360c;
}
.warning-banner strong { font-weight: 700; }
/* Properties table */
.prop-table { width: 100%; border-collapse: collapse; }
.prop-table th, .prop-table td {
text-align: left;
padding: 0.6rem 0.75rem;
border-bottom: 1px solid #f0e4d8;
font-size: 0.9rem;
}
.prop-table th {
font-weight: 600;
color: #5a4a3a;
font-size: 0.78rem;
text-transform: uppercase;
letter-spacing: 0.04em;
padding-top: 0;
}
.prop-table td:first-child {
font-family: 'Fira Code', monospace;
font-weight: 500;
color: #c44536;
white-space: nowrap;
}
.prop-table tr:last-child td { border-bottom: none; }
.type-tag {
display: inline-block;
font-family: 'Fira Code', monospace;
font-size: 0.75rem;
padding: 0.15rem 0.5rem;
border-radius: 4px;
background: #f0e4d8;
color: #7d6b5a;
}
/* Status codes */
.status-list { list-style: none; }
.status-list li {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem 0;
border-bottom: 1px solid #f5ede6;
font-size: 0.9rem;
}
.status-list li:last-child { border-bottom: none; }
.status-code {
display: inline-flex;
align-items: center;
justify-content: center;
font-family: 'Fira Code', monospace;
font-weight: 600;
font-size: 0.78rem;
padding: 0.2rem 0.5rem;
border-radius: 4px;
min-width: 40px;
}
.sc-200 { background: #e8f5e9; color: #2e7d32; }
.sc-401 { background:#ffebee;color:#c62828; }
.sc-404 { background: #fff3e0; color: #e65100; }
.sc-405 { background:#e8eaf6;color:#283593; }
.sc-503 { background: #ffebee; color: #c62828; }
/* Code blocks */
pre {
background: #2d2a24;
color: #f4e9d8;
font-family: 'Fira Code', monospace;
font-size: 0.82rem;
line-height: 1.5;
padding: 1rem 1.25rem;
border-radius: 10px;
overflow-x: auto;
tab-size: 2;
}
code { font-family: 'Fira Code', monospace; }
pre .json-key { color: #f9a875; }
pre .json-string { color: #b8d99c; }
pre .json-number { color: #82c1e0; }
pre .json-bool { color: #d4a0e8; }
pre .json-null { color: #999; }
/* curl example */
.curl-box {
background: #2d2a24;
border-radius: 10px;
overflow: hidden;
}
.curl-box .curl-label {
padding: 0.5rem 1rem;
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.06em;
color: #a09080;
background: #3a3530;
border-bottom: 1px solid #4a4440;
}
.curl-box pre { border-radius: 0; background: transparent; }
/* Section spacing */
.section-title {
font-size: 1rem;
font-weight: 600;
color: #5a4a3a;
margin-bottom: 0.75rem;
}
/* New sections */
.context-box {
background: #fffcf9;
border-radius: 16px;
padding: 1.5rem;
margin-bottom: 2rem;
box-shadow: 0 4px 24px rgba(90, 60, 40, 0.10);
font-size: 0.95rem;
color: #5a4a3a;
line-height: 1.7;
}
h2 {
font-size: 1.25rem;
font-weight: 700;
color: #c44536;
margin: 2rem 0 0.75rem;
letter-spacing: -0.01em;
}
h2:first-of-type { margin-top: 2rem; }
.section-desc {
color: #5a4a3a;
font-size: 0.9rem;
margin-bottom: 1.25rem;
line-height: 1.7;
}
.future-list {
list-style: none;
padding: 0;
margin: 0 0 1.25rem 0;
}
.future-list li {
padding: 0.4rem 0 0.4rem 1.25rem;
position: relative;
color: #5a4a3a;
font-size: 0.9rem;
line-height: 1.6;
}
.future-list li::before {
content: "—";
position: absolute;
left: 0;
color: #c44536;
font-weight: 600;
}
/* Footer */
footer {
text-align: center;
padding: 2rem 0;
color: #9a8a7a;
font-size: 0.8rem;
}
footer a { color: #c44536; text-decoration: none; }
footer a:hover { text-decoration: underline; }
/* Responsive */
@media (max-width: 600px) {
.lang-toggle { position: static; margin-bottom: 1rem; }
header { display: flex; flex-direction: column; align-items: center; }
.endpoint-desc { display: none; }
}
</style>
</head>
<body>
<div class="container">
<header>
<div class="lang-toggle">
<button onclick="setLang('en')" id="lang-en">EN</button>
<button onclick="setLang('ro')" id="lang-ro" class="active">RO</button>
</div>
<a href="https://peviitor.ro" target="_blank" class="logo-link">
<img src="https://peviitor.ro/assets/logo-DV2JQkir.svg" alt="peviitor" class="logo-img">
</a>
<h1 data-i18n="brand">peviitor API</h1>
<p data-i18n="subtitle">Platformă de descoperire a joburilor — documentație API publică</p>
<div class="base-url">https://api.peviitor.ro</div>
<a href="/tests/report.html" target="_blank" class="test-badge-link">
<span class="test-badge">🧪 Test Report</span>
</a>
</header>
<div class="context-box">
<p data-i18n="contextParagraph">
Această pagină expune endpoint-uri publice ale API-ului peviitor.ro, o platformă de descoperire a joburilor.
Suntem în proces de revizuire și extindere a API-ului, iar documentația se va îmbunătăți treptat.
</p>
</div>
<h2 data-i18n="availableEndpointsTitle">Endpoint-uri disponibile în prezent</h2>
<p class="section-desc" data-i18n="availableEndpointsDesc">
Endpoint-urile de mai jos sunt disponibile în acest moment și pot fi folosite pentru testare și explorare.
API-ul este în curs de standardizare, iar pentru fiecare funcționalitate vom publica treptat endpoint-uri noi,
împreună cu o documentație mai detaliată.
</p>
<!-- ============================================= -->
<!-- RANDOM ENDPOINT -->
<!-- ============================================= -->
<!-- RANDOM ENDPOINT -->
<div class="card">
<div class="endpoint-row" onclick="toggleEndpoint('random')">
<span class="method-badge">GET</span>
<span class="endpoint-path">/v1/random/</span>
<span class="endpoint-desc" data-i18n="endpointTag">Get a random job listing</span>
<span class="toggle-arrow" id="arrow-random">▶</span>
</div>
</div>
<div id="random-content" class="endpoint-content" style="display:none">
<div class="card">
<div class="card-body">
<p style="margin-bottom:1rem;color:#5a4a3a;" data-i18n="endpointDesc">
Returns a single random job from the Solr job index. Useful for discovery widgets,
"job of the day" features, or testing integrations.
</p>
<div class="section-title" data-i18n="howItWorksTitle">How it works</div>
<ol style="margin:0 0 1.5rem 1.2rem;color:#5a4a3a;font-size:0.9rem;">
<li data-i18n="how1">Queries Solr for the total number of indexed jobs</li>
<li data-i18n="how2">Picks a random offset between 0 and total count</li>
<li data-i18n="how3">Fetches exactly one document at that offset</li>
<li data-i18n="how4">Returns the job mapped to the peviitor Job Model Schema</li>
</ol>
<div class="section-title" data-i18n="tryItTitle">Try it</div>
<div class="curl-box">
<div class="curl-label">curl</div>
<pre>curl -X GET "https://api.peviitor.ro/v1/random/" \
-H "Accept: application/json"</pre>
</div>
</div>
</div>
<div class="card">
<div class="card-header" data-i18n="respFieldsTitle">Response fields</div>
<div class="card-body">
<table class="prop-table">
<thead><tr>
<th>Field</th><th>Type</th><th data-i18n="description">Description</th>
</tr></thead>
<tbody>
<tr><td>title</td><td><span class="type-tag">string</span></td><td data-i18n="descTitle">Exact job position title</td></tr>
<tr><td>company</td><td><span class="type-tag">string</span></td><td data-i18n="descCompany">Hiring company name (uppercase)</td></tr>
<tr><td>location</td><td><span class="type-tag">string[]</span></td><td data-i18n="descLocation">Array of cities or addresses</td></tr>
<tr><td>workmode</td><td><span class="type-tag">string</span></td><td data-i18n="descWorkmode"><code>remote</code>, <code>on-site</code>, or <code>hybrid</code></td></tr>
<tr><td>url</td><td><span class="type-tag">string</span></td><td data-i18n="descUrl">Full URL to the job detail page (unique key)</td></tr>
<tr><td>salary</td><td><span class="type-tag">string</span></td><td data-i18n="descSalary">Salary interval with currency, e.g. <code>5000-8000 RON</code></td></tr>
<tr><td>tags</td><td><span class="type-tag">string[]</span></td><td data-i18n="descTags">Skill tags (lowercase, max 20)</td></tr>
<tr><td>cif</td><td><span class="type-tag">string</span></td><td data-i18n="descCif">CIF/CUI of the company</td></tr>
<tr><td>date</td><td><span class="type-tag">string</span></td><td data-i18n="descDate">ISO8601 UTC timestamp of indexing</td></tr>
<tr><td>status</td><td><span class="type-tag">string</span></td><td data-i18n="descStatus"><code>scraped</code>, <code>tested</code>, <code>published</code>, or <code>verified</code></td></tr>
</tbody>
</table>
</div>
</div>
<div class="card">
<div class="card-header" data-i18n="successTitle">200 — Success</div>
<div class="card-body">
<pre>{
<span class="json-key">"title"</span>: <span class="json-string">"Inginer IT"</span>,
<span class="json-key">"company"</span>: <span class="json-string">"COMPANY SRL"</span>,
<span class="json-key">"location"</span>: [<span class="json-string">"Bucure\u0219ti"</span>, <span class="json-string">"Cluj-Napoca"</span>],
<span class="json-key">"workmode"</span>: <span class="json-string">"remote"</span>,
<span class="json-key">"url"</span>: <span class="json-string">"https://example.com/job/123"</span>,
<span class="json-key">"salary"</span>: <span class="json-string">"5000-8000 RON"</span>,
<span class="json-key">"tags"</span>: [<span class="json-string">"python"</span>, <span class="json-string">"java"</span>],
<span class="json-key">"cif"</span>: <span class="json-string">"12345678"</span>,
<span class="json-key">"date"</span>: <span class="json-string">"2026-06-15T10:00:00Z"</span>,
<span class="json-key">"status"</span>: <span class="json-string">"published"</span>
}</pre>
</div>
</div>
<div class="card">
<div class="card-header">404 — <span data-i18n="notFoundTitle">No Jobs Found</span></div>
<div class="card-body">
<pre>{
<span class="json-key">"error"</span>: <span class="json-string">"No jobs found"</span>
}</pre>
</div>
</div>
<div class="card">
<div class="card-header">503 — <span data-i18n="unavailTitle">Service Unavailable</span></div>
<div class="card-body">
<pre>{
<span class="json-key">"error"</span>: <span class="json-string">"Job core unavailable"</span>,
<span class="json-key">"details"</span>: <span class="json-string">"PROD_SERVER not set"</span>
}</pre>
</div>
</div>
<div class="card">
<div class="card-header"><span data-i18n="requirementsTitle">Requirements</span> — <span data-i18n="randomEndpoint">Random</span></div>
<div class="card-body">
<table class="prop-table">
<thead><tr><th style="width:100px" data-i18n="item">Item</th><th data-i18n="details">Details</th></tr></thead>
<tbody>
<tr><td data-i18n="method">Method</td><td><code>GET</code> only</td></tr>
<tr><td data-i18n="auth">Auth</td><td data-i18n="authVal">None (public endpoint)</td></tr>
<tr><td data-i18n="params">Params</td><td data-i18n="paramsVal">None</td></tr>
<tr><td data-i18n="contentType">Content-Type</td><td><code>application/json</code></td></tr>
</tbody>
</table>
</div>
</div>
<div class="card">
<div class="card-header" data-i18n="statusCodesTitle">Status codes</div>
<div class="card-body">
<ul class="status-list">
<li><span class="status-code sc-200">200</span><span data-i18n="status200">A random job was found and returned successfully</span></li>
<li><span class="status-code sc-404">404</span><span data-i18n="status404">No jobs are currently indexed in the Solr core</span></li>
<li><span class="status-code sc-503">503</span><span data-i18n="status503">Solr core is unavailable or environment not configured</span></li>
</ul>
</div>
</div>
</div>
<!-- ============================================= -->
<!-- TOTAL ENDPOINT -->
<!-- ============================================= -->
<div class="card">
<div class="endpoint-row" onclick="toggleEndpoint('total')">
<span class="method-badge">GET</span>
<span class="endpoint-path">/v1/total/</span>
<span class="endpoint-desc" data-i18n="totalTag">Get total jobs and companies count</span>
<span class="toggle-arrow" id="arrow-total">▶</span>
</div>
</div>
<div id="total-content" class="endpoint-content" style="display:none">
<div class="card">
<div class="card-body">
<p style="margin-bottom:1rem;color:#5a4a3a;" data-i18n="totalDesc">
Returns the total number of job listings and companies currently indexed in the Solr cores.
Useful for dashboard counters, statistics widgets, or monitoring integrations.
</p>
<div class="section-title" data-i18n="howItWorksTitle">How it works</div>
<ol style="margin:0 0 1.5rem 1.2rem;color:#5a4a3a;font-size:0.9rem;">
<li data-i18n="totalHow1">Queries the <code>job</code> Solr core for the total number of indexed jobs</li>
<li data-i18n="totalHow2">Queries the <code>company</code> Solr core for the total number of indexed companies</li>
<li data-i18n="totalHow3">Returns both counts in a single response object</li>
</ol>
<div class="section-title" data-i18n="tryItTitle">Try it</div>
<div class="curl-box">
<div class="curl-label">curl</div>
<pre>curl -X GET "https://api.peviitor.ro/v1/total/" \
-H "Accept: application/json"</pre>
</div>
</div>
</div>
<div class="card">
<div class="card-header" data-i18n="totalRespFieldsTitle">Response fields</div>
<div class="card-body">
<table class="prop-table">
<thead><tr>
<th>Field</th><th>Type</th><th data-i18n="description">Description</th>
</tr></thead>
<tbody>
<tr><td>total</td><td><span class="type-tag">object</span></td><td data-i18n="totalDescTotal">Container object with count fields</td></tr>
<tr><td>total.jobs</td><td><span class="type-tag">number</span></td><td data-i18n="totalDescJobs">Total number of job listings currently indexed</td></tr>
<tr><td>total.companies</td><td><span class="type-tag">number</span></td><td data-i18n="totalDescCompanies">Total number of companies currently indexed</td></tr>
</tbody>
</table>
</div>
</div>
<div class="card">
<div class="card-header" data-i18n="successTitle">200 — Success</div>
<div class="card-body">
<pre>{
<span class="json-key">"total"</span>: {
<span class="json-key">"jobs"</span>: <span class="json-number">18452</span>,
<span class="json-key">"companies"</span>: <span class="json-number">934</span>
}
}</pre>
</div>
</div>
<div class="card">
<div class="card-header">405 — <span data-i18n="methodNotAllowedTitle">Method Not Allowed</span></div>
<div class="card-body">
<pre>{
<span class="json-key">"error"</span>: <span class="json-string">"Only GET method allowed"</span>
}</pre>
</div>
</div>
<div class="card">
<div class="card-header">503 — <span data-i18n="unavailTitle">Service Unavailable</span></div>
<div class="card-body">
<p style="margin-bottom:0.75rem;color:#5a4a3a;font-size:0.9rem;" data-i18n="totalErrorDesc">
Triggered when Solr is unreachable, returns an invalid response, or the environment is not configured.
The <code>details</code> field contains the underlying error message for debugging.
</p>
<pre style="margin-bottom:0.75rem">{
<span class="json-key">"error"</span>: <span class="json-string">"Job core unavailable"</span>,
<span class="json-key">"details"</span>: <span class="json-string">"SOLR_SERVER not set"</span>
}</pre>
<pre style="margin-bottom:0.75rem">{
<span class="json-key">"error"</span>: <span class="json-string">"Job core unavailable"</span>,
<span class="json-key">"details"</span>: <span class="json-string">"FETCH FAILED: http://... | Connection timed out"</span>
}</pre>
<pre>{
<span class="json-key">"error"</span>: <span class="json-string">"Job core unavailable"</span>,
<span class="json-key">"details"</span>: <span class="json-string">"Invalid JSON response"</span>
}</pre>
</div>
</div>
<div class="card">
<div class="card-header"><span data-i18n="requirementsTitle">Requirements</span> — <span data-i18n="totalEndpoint">Total</span></div>
<div class="card-body">
<table class="prop-table">
<thead><tr><th style="width:100px" data-i18n="item">Item</th><th data-i18n="details">Details</th></tr></thead>
<tbody>
<tr><td data-i18n="method">Method</td><td><code>GET</code> only</td></tr>
<tr><td data-i18n="auth">Auth</td><td data-i18n="authVal">None (public endpoint)</td></tr>
<tr><td data-i18n="params">Params</td><td data-i18n="paramsVal">None</td></tr>
<tr><td data-i18n="contentType">Content-Type</td><td><code>application/json</code></td></tr>
</tbody>
</table>
</div>
</div>
<div class="card">
<div class="card-header" data-i18n="statusCodesTitle">Status codes</div>
<div class="card-body">
<ul class="status-list">
<li><span class="status-code sc-200">200</span><span data-i18n="totalStatus200">Counts for jobs and companies returned successfully</span></li>
<li><span class="status-code sc-405">405</span><span data-i18n="totalStatus405">Request method is not GET</span></li>
<li><span class="status-code sc-503">503</span><span data-i18n="totalStatus503">Solr core is unreachable, returned invalid JSON, or environment is not configured</span></li>
</ul>
</div>
</div>
</div>
<!-- ============================================= -->
<!-- CLEANJOBS ENDPOINT -->
<!-- ============================================= -->
<div class="card">
<div class="endpoint-row endpoint-row-delete" onclick="toggleEndpoint('cleanjobs')">
<span class="method-badge method-badge-delete">DELETE</span>
<span class="endpoint-path">/v1/cleanjobs/</span>
<span class="endpoint-desc" data-i18n="cleanjobsTag">Delete job records for a company</span>
<span class="toggle-arrow" id="arrow-cleanjobs">▶</span>
</div>
</div>
<div id="cleanjobs-content" class="endpoint-content" style="display:none">
<div class="card">
<div class="card-body">
<div class="warning-banner" data-i18n="cleanjobsWarning">
<strong>Warning:</strong> This action permanently deletes ALL job records for the specified company from the Solr database. This cannot be undone.
</div>
<p style="margin-bottom:1rem;color:#5a4a3a;" data-i18n="cleanjobsDesc">
Permanently deletes every job document matching the given company from the <code>job</code> Solr core.
Designed for company website owners who want to remove their listings from the peviitor platform.
</p>
<div class="section-title" data-i18n="howItWorksTitle">How it works</div>
<ol style="margin:0 0 1.5rem 1.2rem;color:#5a4a3a;font-size:0.9rem;">
<li data-i18n="cleanjobsHow1">Identify the company by <code>company</code> name, <code>cif</code>, or <code>brand</code></li>
<li data-i18n="cleanjobsHow2">Compute <code>X-Api-Key</code> as MD5 hash based on the provided identifiers</li>
<li data-i18n="cleanjobsHow3">Send a DELETE request with confirmation body</li>
<li data-i18n="cleanjobsHow4">All matching jobs are permanently removed from the index</li>
</ol>
<div class="section-title" data-i18n="authTitle">Authentication</div>
<p style="margin-bottom:1rem;color:#5a4a3a;font-size:0.9rem;" data-i18n="cleanjobsAuthDesc">
You must provide an <code>X-Api-Key</code> header computed as <code>md5()</code> of the identifiers you send.
The key is generated from the same fields in the request body:
</p>
<table class="prop-table" style="margin-bottom:1.5rem;">
<thead><tr><th>Body fields</th><th>X-Api-Key formula</th></tr></thead>
<tbody>
<tr><td><code>company</code> + <code>cif</code></td><td><code>md5(company + cif)</code> <span style="color:#4a7c5a;font-size:0.8rem;">(recommended)</span></td></tr>
<tr><td><code>company</code> only</td><td><code>md5(company)</code></td></tr>
<tr><td><code>brand</code> only</td><td><code>md5(brand)</code></td></tr>
</tbody>
</table>
<div class="section-title" data-i18n="cleanjobsBodyTitle">Request body</div>
<pre>{
<span class="json-key">"company"</span>: <span class="json-string">"NUME SRL"</span>,
<span class="json-key">"cif"</span>: <span class="json-string">"12345678"</span>,
<span class="json-key">"confirmation"</span>: <span class="json-string">"CLEAN_COMPANY_JOBS"</span>
}</pre>
<p style="margin:0.5rem 0 0;color:#7d6b5a;font-size:0.85rem;" data-i18n="cleanjobsBodyNote">
At least one of <code>company</code>, <code>cif</code>, or <code>brand</code> is required.
The <code>confirmation</code> field must be exactly <code>"CLEAN_COMPANY_JOBS"</code>.
</p>
<div class="section-title" data-i18n="tryItTitle">Try it</div>
<div class="curl-box">
<div class="curl-label">curl</div>
<pre>COMPANY="NUME SRL"
CIF="12345678"
KEY=$(echo -n "${COMPANY}${CIF}" | md5sum | cut -d' ' -f1)
curl -X DELETE "https://api.peviitor.ro/v1/cleanjobs/" \
-H "X-Api-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{
"company": "'"$COMPANY"'",
"cif": "'"$CIF"'",
"confirmation": "CLEAN_COMPANY_JOBS"
}'</pre>
</div>
</div>
</div>
<div class="card">
<div class="card-header" data-i18n="cleanjobsRespTitle">Response fields</div>
<div class="card-body">
<table class="prop-table">
<thead><tr><th>Field</th><th>Type</th><th data-i18n="description">Description</th></tr></thead>
<tbody>
<tr><td>message</td><td><span class="type-tag">string</span></td><td data-i18n="cleanjobsRespMessage">Success confirmation message</td></tr>
<tr><td>jobCount</td><td><span class="type-tag">number</span></td><td data-i18n="cleanjobsRespJobCount">Number of jobs deleted</td></tr>
<tr><td>company</td><td><span class="type-tag">string</span></td><td data-i18n="cleanjobsRespCompany">Company name (if provided)</td></tr>
<tr><td>cif</td><td><span class="type-tag">string</span></td><td data-i18n="cleanjobsRespCif">Company CIF (if provided)</td></tr>
<tr><td>brand</td><td><span class="type-tag">string</span></td><td data-i18n="cleanjobsRespBrand">Company brand (if provided)</td></tr>
</tbody>
</table>
</div>
</div>
<div class="card">
<div class="card-header" data-i18n="successTitle">200 — Success</div>
<div class="card-body">
<pre>{
<span class="json-key">"message"</span>: <span class="json-string">"Jobs deleted successfully"</span>,
<span class="json-key">"jobCount"</span>: <span class="json-number">42</span>,
<span class="json-key">"company"</span>: <span class="json-string">"NUME SRL"</span>,
<span class="json-key">"cif"</span>: <span class="json-string">"12345678"</span>
}</pre>
</div>
</div>
<div class="card">
<div class="card-header">401 — <span data-i18n="unauthTitle">Unauthorized</span></div>
<div class="card-body">
<pre>{
<span class="json-key">"error"</span>: <span class="json-string">"Unauthorized - invalid X-Api-Key"</span>
}</pre>
</div>
</div>
<div class="card">
<div class="card-header">404 — <span data-i18n="cleanjobsNotFoundTitle">No Jobs Found</span></div>
<div class="card-body">
<pre>{
<span class="json-key">"error"</span>: <span class="json-string">"No jobs found"</span>,
<span class="json-key">"message"</span>: <span class="json-string">"No jobs found matching the given criteria"</span>
}</pre>
</div>
</div>
<div class="card">
<div class="card-header">405 — <span data-i18n="methodNotAllowedTitle">Method Not Allowed</span></div>
<div class="card-body">
<pre>{
<span class="json-key">"error"</span>: <span class="json-string">"Only DELETE method allowed"</span>
}</pre>
</div>
</div>
<div class="card">
<div class="card-header">503 — <span data-i18n="unavailTitle">Service Unavailable</span></div>
<div class="card-body">
<pre>{
<span class="json-key">"error"</span>: <span class="json-string">"Job core unavailable"</span>,
<span class="json-key">"details"</span>: <span class="json-string">"PROD_SERVER not set"</span>
}</pre>
</div>
</div>
<div class="card">
<div class="card-header"><span data-i18n="requirementsTitle">Requirements</span> — <span data-i18n="cleanjobsEndpoint">Cleanjobs</span></div>
<div class="card-body">
<table class="prop-table">
<thead><tr><th style="width:120px" data-i18n="item">Item</th><th data-i18n="details">Details</th></tr></thead>
<tbody>
<tr><td data-i18n="method">Method</td><td><code>DELETE</code> only</td></tr>
<tr><td data-i18n="auth">Auth</td><td><code>X-Api-Key: md5(company + cif)</code> (or <code>md5(company)</code> / <code>md5(brand)</code>)</td></tr>
<tr><td data-i18n="params">Params</td><td data-i18n="cleanjobsParamsVal">Body: <code>{"company"?: "...", "cif"?: "...", "brand"?: "...", "confirmation": "CLEAN_COMPANY_JOBS"}</code></td></tr>
<tr><td data-i18n="contentType">Content-Type</td><td><code>application/json</code></td></tr>
</tbody>
</table>
</div>
</div>
<div class="card">
<div class="card-header" data-i18n="statusCodesTitle">Status codes</div>
<div class="card-body">
<ul class="status-list">
<li><span class="status-code sc-200">200</span><span data-i18n="cleanjobsStatus200">Jobs were deleted successfully</span></li>
<li><span class="status-code sc-401">401</span><span data-i18n="cleanjobsStatus401">Invalid or missing X-Api-Key header</span></li>
<li><span class="status-code sc-404">404</span><span data-i18n="cleanjobsStatus404">No jobs found matching the given criteria</span></li>
<li><span class="status-code sc-405">405</span><span data-i18n="cleanjobsStatus405">Only DELETE method is allowed</span></li>
<li><span class="status-code sc-503">503</span><span data-i18n="cleanjobsStatus503">Solr core is unavailable or environment not configured</span></li>
</ul>
</div>
</div>
</div>
<h2 data-i18n="statusTitle">Stare curentă a API-ului</h2>
<p class="section-desc" data-i18n="statusDesc">Lucrăm la:</p>
<ul class="future-list">
<li data-i18n="statusItem1">documentarea completă a API-ului pe baza unei specificații publice (de tip OpenAPI/Swagger)</li>
<li data-i18n="statusItem2">introducerea unui mecanism de validare a domeniilor (prin înregistrări DNS TXT) pentru a lega cheile API de website-ul companiei</li>
<li data-i18n="statusItem3">definirea unor endpoint-uri dedicate pentru gestionarea joburilor (creare, actualizare, închidere) într-un mod standardizat</li>
</ul>
<p class="section-desc" data-i18n="statusFooter">Pe măsură ce noile endpoint-uri vor deveni disponibile, le vom publica aici împreună cu exemple de request/response și recomandări de integrare.</p>
<h2 data-i18n="integrationTitle">Cum vei putea integra website-ul tău (în curând)</h2>
<p class="section-desc" data-i18n="integrationDesc">
Obiectivul nostru este să oferim un mod simplu și automat prin care website-urile de companii să trimită joburi către peviitor.ro prin API.
Designul urmărit este:
</p>
<ul class="future-list">
<li data-i18n="integrationItem1">cheile de API vor fi asociate unui domeniu de website (de exemplu, <code>exemplu.com</code>)</li>
<li data-i18n="integrationItem2">domeniul va putea fi dovedit printr-o înregistrare DNS TXT, astfel încât doar proprietarul domeniului să poată publica joburi în numele acelei companii</li>
<li data-i18n="integrationItem3">endpoint-uri dedicate pentru creare, actualizare și închidere joburi vor fi documentate public, cu exemple clare de integrare</li>
</ul>
<p class="section-desc" data-i18n="integrationFooter">Pe măsură ce aceste componente vor fi gata, le vom documenta pe această pagină.</p>
<footer>
Powered by <a href="https://peviitor.ro" target="_blank">peviitor.ro</a> ·
<a href="https://github.com/peviitor-ro/api" target="_blank">GitHub</a>
</footer>
</div>
<script>
const i18n = {
en: {
brand: "peviitor API",
subtitle: "Job discovery platform \u2014 public API documentation",
endpointTag: "Get a random job listing",
endpointDesc: "Returns a single random job from the Solr job index. Useful for discovery widgets, \u201Cjob of the day\u201D features, or testing integrations.",
howItWorksTitle: "How it works",
how1: "Queries Solr for the total number of indexed jobs",
how2: "Picks a random offset between 0 and total count",
how3: "Fetches exactly one document at that offset",
how4: "Returns the job mapped to the peviitor Job Model Schema",
tryItTitle: "Try it",
respFieldsTitle: "Response fields",
description: "Description",
descTitle: "Exact job position title",
descCompany: "Hiring company name (uppercase)",
descLocation: "Array of cities or addresses",
descWorkmode: "<code>remote</code>, <code>on-site</code>, or <code>hybrid</code>",
descUrl: "Full URL to the job detail page (unique key)",
descSalary: "Salary interval with currency, e.g. <code>5000-8000 RON</code>",
descTags: "Skill tags (lowercase, max 20)",
descCif: "CIF/CUI of the company",
descDate: "ISO8601 UTC timestamp of indexing",
descStatus: "<code>scraped</code>, <code>tested</code>, <code>published</code>, or <code>verified</code>",
successTitle: "200 \u2014 Success",
notFoundTitle: "No Jobs Found",
unavailTitle: "Service Unavailable",
statusCodesTitle: "Status codes",
status200: "A random job was found and returned successfully",
status404: "No jobs are currently indexed in the Solr core",
status503: "Solr core is unavailable or environment not configured",
requirementsTitle: "Requirements",
item: "Item",
details: "Details",
method: "Method",
auth: "Auth",
authVal: "None (public endpoint)",
params: "Params",
paramsVal: "None",
contentType: "Content-Type",
emptyTag: "Delete all job records",
emptyWarning: "<strong>Warning:</strong> This action permanently deletes ALL job records from the Solr database. This cannot be undone.",
emptyDesc: "Permanently deletes every job document from the <code>job</code> Solr core. In production, requires valid API credentials.",
authTitle: "Authentication",
emptyAuthDesc: "In <strong>production</strong> mode (<code>NODE_ENV=production</code>), you must provide <code>X-API-Key</code> and <code>X-Cleanup-Secret</code> headers matching <code>api.env</code>. In any other environment (<strong>test</strong>, <strong>dev</strong>, <strong>staging</strong>, etc.), these headers are <em>not checked</em> and any value is accepted.",
requestHeadersTitle: "Request headers",
emptyApiKeyReq: "Production only",
emptySecretReq: "Production only",
emptyApiKeyDesc: "API key from <code>CLEANUP_API_KEY</code> in api.env",
emptySecretDesc: "Secret from <code>CLEANUP_SECRET</code> in api.env",
yes: "Yes",
requestBodyTitle: "Request body",
emptySuccessTitle: "200 \u2014 Jobs Deleted",
emptyUnauthTitle: "Unauthorized",
methodNotAllowedTitle: "Method Not Allowed",
emptyEndpoint: "Empty endpoint",
emptyStatus200: "All jobs were deleted successfully",
emptyStatus401: "Invalid or missing credentials (production only)",
emptyStatus405: "Only DELETE method is allowed",
emptyStatus503: "Solr core is unavailable or environment not configured",
randomEndpoint: "Random endpoint",
emptyAuthReq: "<code>X-API-Key</code> + <code>X-Cleanup-Secret</code> (production only)",
emptyParamsVal: "Body: <code>{\"confirmation\": \"DELETE_ALL_DATA\"}</code>",
cleanjobsTag: "Delete job records for a company",
cleanjobsWarning: "<strong>Warning:</strong> This action permanently deletes ALL job records for the specified company from the Solr database. This cannot be undone.",
cleanjobsDesc: "Permanently deletes every job document matching the given company from the <code>job</code> Solr core. Designed for company website owners who want to remove their listings from the peviitor platform.",
cleanjobsHow1: "Identify the company by <code>company</code> name, <code>cif</code>, or <code>brand</code>",
cleanjobsHow2: "Compute <code>X-Api-Key</code> as MD5 hash based on the provided identifiers",
cleanjobsHow3: "Send a DELETE request with confirmation body",
cleanjobsHow4: "All matching jobs are permanently removed from the index",
cleanjobsAuthDesc: "You must provide an <code>X-Api-Key</code> header computed as <code>md5()</code> of the identifiers you send. The key is generated from the same fields in the request body:",
cleanjobsBodyTitle: "Request body",
cleanjobsBodyNote: "At least one of <code>company</code>, <code>cif</code>, or <code>brand</code> is required. The <code>confirmation</code> field must be exactly <code>\"CLEAN_COMPANY_JOBS\"</code>.",
cleanjobsRespTitle: "Response fields",
cleanjobsRespMessage: "Success confirmation message",
cleanjobsRespJobCount: "Number of jobs deleted",
cleanjobsRespCompany: "Company name (if provided)",
cleanjobsRespCif: "Company CIF (if provided)",
cleanjobsRespBrand: "Company brand (if provided)",
cleanjobsNotFoundTitle: "No Jobs Found",
cleanjobsEndpoint: "Cleanjobs",
cleanjobsParamsVal: "Body: <code>{\"company\"?: \"...\", \"cif\"?: \"...\", \"brand\"?: \"...\", \"confirmation\": \"CLEAN_COMPANY_JOBS\"}</code>",
cleanjobsStatus200: "Jobs were deleted successfully",
cleanjobsStatus401: "Invalid or missing X-Api-Key header",
cleanjobsStatus404: "No jobs found matching the given criteria",
cleanjobsStatus405: "Only DELETE method is allowed",
cleanjobsStatus503: "Solr core is unavailable or environment not configured",
unauthTitle: "Unauthorized",
contextParagraph: "This page exposes public endpoints of the peviitor.ro API, a job discovery platform. We are in the process of reviewing and expanding the API, and the documentation will gradually improve.",
availableEndpointsTitle: "Currently available endpoints",
availableEndpointsDesc: "The endpoints below are available right now and can be used for testing and exploration. The API is being standardized, and we will gradually publish new endpoints along with more detailed documentation.",
statusTitle: "Current API Status",
statusDesc: "We are working on:",
statusItem1: "full API documentation based on a public specification (OpenAPI/Swagger)",
statusItem2: "introducing a domain validation mechanism (via DNS TXT records) to link API keys to company websites",
statusItem3: "defining dedicated endpoints for job management (create, update, close) in a standardized way",
statusFooter: "As new endpoints become available, we will publish them here along with request/response examples and integration recommendations.",
integrationTitle: "How you will be able to integrate your website (coming soon)",
integrationDesc: "Our goal is to provide a simple, automated way for company websites to submit jobs to peviitor.ro via API. The intended design is:",
integrationItem1: "API keys will be associated with a website domain (e.g. <code>example.com</code>)",
integrationItem2: "the domain can be proven via a DNS TXT record, so only the domain owner can publish jobs on behalf of that company",
integrationItem3: "dedicated endpoints for creating, updating, and closing jobs will be publicly documented with clear integration examples",
integrationFooter: "As these components are ready, we will document them on this page.",
},
ro: {
brand: "peviitor API",
subtitle: "Platform\u0103 de descoperire a joburilor \u2014 documenta\u021bie API public\u0103",
endpointTag: "Ob\u021Bine un job aleator",
endpointDesc: "Returneaz\u0103 un singur job aleator din indexul Solr. Util pentru widget-uri de descoperire, func\u021Bii de \u201Cjobul zilei\u201D sau testarea integr\u0103rilor.",
howItWorksTitle: "Cum func\u021Bioneaz\u0103",
how1: "Interogheaz\u0103 Solr pentru num\u0103rul total de jobs indexate",
how2: "Alege un offset aleator \u00Eentre 0 \u0219i num\u0103rul total",
how3: "Preia exact un document la acel offset",
how4: "Returneaz\u0103 jobul mapat conform Job Model Schema peviitor",
tryItTitle: "\u00CEncearc\u0103",
respFieldsTitle: "C\u00E2mpurile r\u0103spunsului",
description: "Descriere",
descTitle: "Titlul exact al pozi\u021Biei",
descCompany: "Numele companiei angajatoare (majuscule)",
descLocation: "List\u0103 de ora\u0219e sau adrese",
descWorkmode: "<code>remote</code>, <code>on-site</code> sau <code>hybrid</code>",
descUrl: "URL complet c\u0103tre pagina jobului (cheie unic\u0103)",
descSalary: "Interval salarial cu moned\u0103, ex. <code>5000-8000 RON</code>",
descTags: "Tag-uri de skills (lowercase, max 20)",
descCif: "CIF/CUI al companiei",
descDate: "Timestamp ISO8601 UTC al index\u0103rii",
descStatus: "<code>scraped</code>, <code>tested</code>, <code>published</code> sau <code>verified</code>",
successTitle: "200 \u2014 Succes",
notFoundTitle: "Niciun job g\u0103sit",
unavailTitle: "Serviciu indisponibil",
statusCodesTitle: "Coduri de stare",
status200: "Un job aleator a fost g\u0103sit \u0219i returnat cu succes",
status404: "Nu exist\u0103 joburi indexate \u00EEn core-ul Solr",
status503: "Core-ul Solr este indisponibil sau mediul nu este configurat",
requirementsTitle: "Cerin\u021Be",
item: "Element",
details: "Detalii",
method: "Metod\u0103",
auth: "Autentificare",
authVal: "Niciuna (endpoint public)",
params: "Parametri",