Die FWF Open API basiert auf Meilisearch. Eine umfassende Dokumentation finden Sie in der Meilisearch-API-Dokumentation. Der Lesezugriff ist mithilfe des FWF Open API Keys möglich.
FWF Open API: Beispiel-Abfragen
Abfrage von Projekten
Alle Projektinformationen befinden sich im Index „projects“. Um diese Projekte ohne weitere Sucheinschränkungen abzufragen, können sie in Batches abgefragt werden. Die Batch-Größe kann dabei mit dem Parameter „limit“ und das Startelement mit „offset“ bestimmt werden. Um zum Beispiel 1000 Projekte beginnend beim 2001. Projekt abzufragen, müsste „limit“ auf 1000 und „offset“ auf 2000 gesetzt werden:
cURL
curl -X GET 'https://openapi.fwf.ac.at/indexes/projects/documents?limit=1000&offset=2000' -H 'Authorization: Bearer <FWF Open API Key>'
Python
import meilisearch
client = meilisearch.Client('https://openapi.fwf.ac.at', '<FWF Open API Key>')
batch = client.index('projects').get_documents({'limit':1000, 'offset': 2000})
projects = [dict(proj) for proj in batch.results]
JavaScript
const { Meilisearch } = require("meilisearch");
const client = new Meilisearch({host: "https://openapi.fwf.ac.at", apiKey: "<FWF Open API Key>",});
const batch = await client.index('projects').getDocuments({limit: 1000, offset: 2000})
const projects = batch.results;
PHP
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Meilisearch\Client;
use Meilisearch\Contracts\DocumentsQuery;
$client = new Client('https://openapi.fwf.ac.at', '<FWF Open API Key>');
$projects = $client->index('projects')->getDocuments((new DocumentsQuery())->setOffset(2000)->setLimit(1000))->getResults();
Abfrage von Research-Output
Analog zur Abfrage der Projekte kann auch der Research-Output abgefragt werden. Dieser befindet sich im Index „output“. Falls Sie die 200 Einträge ab dem 301. Eintrag abfragen wollen, können Sie den Output beispielsweise folgendermaßen abfragen:
cURL
curl -X GET 'https://openapi.fwf.ac.at/indexes/output/documents?limit=200&offset=300' -H 'Authorization: Bearer <FWF Open API Key>'
Python
import meilisearch
client = meilisearch.Client('https://openapi.fwf.ac.at', '<FWF Open API Key>')
batch = client.index('output').get_documents({'limit':200, 'offset': 300})
output = [dict(out) for out in batch.results]
JavaScript
const { Meilisearch } = require("meilisearch");
const client = new Meilisearch({host: "https://openapi.fwf.ac.at", apiKey: "<FWF Open API Key>",});
const batch = await client.index('output').getDocuments({limit: 200, offset: 300})
const output = batch.results;
PHP
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Meilisearch\Client;
use Meilisearch\Contracts\DocumentsQuery;
$client = new Client('https://openapi.fwf.ac.at', '<FWF Open API Key>');
$output = $client->index('output')->getDocuments((new DocumentsQuery())->setOffset(300)->setLimit(200))->getResults();
Abfrage von weiteren Förderungen
Weitere Förderungen vom FWF oder von anderen Organisationen in Bezug auf das jeweilige Projekt befinden sich im Index „further-funding“. Auch dieser kann unter Angabe der Parameter „limit“ und „offset“ abgefragt werden. Ist „limit“ auf 100 und „offset“ auf 200 gesetzt, werden 100 weitere Förderungen abgefragt, beginnend beim 201. Eintrag:
cURL
curl -X GET 'https://openapi.fwf.ac.at/indexes/further-funding/documents?limit=100&offset=200' -H 'Authorization: Bearer <FWF Open API Key>'
Python
import meilisearch
client = meilisearch.Client('https://openapi.fwf.ac.at', '<FWF Open API Key>')
batch = client.index('further-funding').get_documents({'limit':100, 'offset': 200})
funding = [dict(fun) for fun in batch.results]
JavaScript
const { Meilisearch } = require("meilisearch");
const client = new Meilisearch({host: "https://openapi.fwf.ac.at", apiKey: "<FWF Open API Key>",});
const batch = await client.index('further-funding').getDocuments({limit: 100, offset: 200})
const funding = batch.results;
PHP
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Meilisearch\Client;
use Meilisearch\Contracts\DocumentsQuery;
$client = new Client('https://openapi.fwf.ac.at', '<FWF Open API Key>');
$funding = $client->index('further-funding')->getDocuments((new DocumentsQuery())->setOffset(200)->setLimit(100))->getResults();
Abfrage eines Projekts
Um ein bestimmtes Projekt abzufragen, kann im Index „projects“ nach der Grant-DOI des Projekts gesucht werden. Da die Meilisearch-Suche standardmäßig nicht nur exakte Treffer ausgibt, sondern auch kleine Abweichungen zum gesuchten Text erlaubt, ist es hier notwendig, die Grant-DOI mit Anführungszeichen zu versehen, damit nur exakte Treffer ausgegeben werden.
Nachfolgend finden Sie die Abfrage für das Projekt DOC32. Um ein anderes Projekt abzufragen, können Sie „DOC32“ einfach mit der gewünschten FWF-ID ersetzen.
cURL
curl -X POST 'https://openapi.fwf.ac.at/indexes/projects/search' -H 'Content-Type: application/json' -H 'Authorization: Bearer <FWF Open API Key>' --data-binary '{"q": "\"10.55776/DOC32\""}'
Python
import meilisearch
client = meilisearch.Client('https://openapi.fwf.ac.at', '<FWF Open API Key>')
project = client.index('projects').search('\"10.55776/DOC32\"')
JavaScript
const { Meilisearch } = require("meilisearch");
const client = new Meilisearch({host: "https://openapi.fwf.ac.at", apiKey: "<FWF Open API Key>",});
const project = await client.index("projects").search("\"10.55776/DOC32\"");
PHP
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Meilisearch\Client;
$client = new Client('https://openapi.fwf.ac.at', '<FWF Open API Key>');
$project = $client->index('projects')->search('\"10.55776/DOC32\")->getHits();
Abfrage aller Projekte mit einem Stichwort
Es können auch alle Projekte gesucht werden, die im Projekttitel, ihrer PR-Kurzbeschreibung, ihrer Disziplin oder einem der anderen Felder ein bestimmtes Stichwort beinhalten. Hierfür müssen Sie im „projects“-Index nach dem gewünschten Wort suchen, zum Beispiel „Open Access“.
cURL
curl -X POST 'https://openapi.fwf.ac.at/indexes/projects/search' -H 'Content-Type: application/json' -H 'Authorization: Bearer <FWF Open API Key>' --data-binary '{"q": "\"open-access\"", "limit": 1000}'
Python
import meilisearch
client = meilisearch.Client('https://openapi.fwf.ac.at', '<FWF Open API Key>')
projects = client.index('projects').search('\"open-access\"', {'limit':1000})
JavaScript
const { Meilisearch } = require("meilisearch");
const client = new Meilisearch({host: "https://openapi.fwf.ac.at", apiKey: "<FWF Open API Key>",});
const projects = await client.index("projects").search("\"open-access\"", limit=1000);
PHP
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Meilisearch\Client;
$client = new Client('https://openapi.fwf.ac.at', '<FWF Open API Key>');
$projects = $client->index('projects')->search('\"open-access\"', ['limit'=>1000])->getHits();
Abfrage aller Projekte einer Forschungsstätte
Um alle Projekte zu identifizieren, die mit einer bestimmten Forschungsstätte verbunden sind, kann der „projects“-Index nach dem Namen der Forschungsstätte durchsucht werden, zum Beispiel nach „Medizinische Universität Wien“:
cURL
curl -X POST 'https://openapi.fwf.ac.at/indexes/projects/search' -H 'Content-Type: application/json' -H 'Authorization: Bearer <FWF Open API Key>' --data-binary '{"q": "\"Medizinische Universit\u00e4t Wien\"", "limit": 1000}'
Python
import meilisearch
client = meilisearch.Client('https://openapi.fwf.ac.at', '<FWF Open API Key>')
projects = client.index('projects').search('\"Medizinische Universität Wien\"', {'limit':1000})
JavaScript
const { Meilisearch } = require("meilisearch");
const client = new Meilisearch({host: "https://openapi.fwf.ac.at", apiKey: "<FWF Open API Key>",});
const projects = await client.index("projects").search("\"Medizinische Universit\u00e4t Wien\"", limit=1000);
PHP
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Meilisearch\Client;
$client = new Client('https://openapi.fwf.ac.at', '<FWF Open API Key>');
$projects = $client->index('projects')->search('\"Medizinische Universität Wien\"', ['limit'=>1000])->getHits();
Diese Abfrage durchsucht alle Felder nach der gewünschten Forschungsstätte. Um nur jene Projekte zu identifizieren, die auf eine bestimmte Art mit der Forschungsstätte verknüpft sind, müssen die Ergebnisse im Anschluss weiter gefiltert werden.
Da nicht alle Felder auf Deutsch und auf Englisch verfügbar sind, führen Suchanfragen mit den deutschen Namen der Forschungsstätten wahrscheinlich zu mehr Treffern.
Abfrage von Output und weiteren Förderungen
Der Research-Output eines Projekts befindet sich im Index „output“, die weiteren Förderungen in Bezug auf das jeweilige Projekt im Index „further-funding“. Um beides zu identifizieren, können diese Indizes auf die ID des Projekts in der API durchsucht werden. Diese ID wird dabei immer als „project-<FWF-ID>“ aus der FWF-ID gebildet. Sind Sie zum Beispiel am Output und weiteren Förderungen des Projekts DOC32 interessiert, würden Sie nach „project-DOC32“ suchen:
cURL
curl -X POST 'https://openapi.fwf.ac.at/multi-search' -H 'Content-Type: application/json' -H 'Authorization: Bearer <FWF Open API Key>' --data-binary '{"queries": [{"indexUid": "output", "q": "\"project-DOC32\"", "limit": 1000}, {"indexUid": "further-funding", "q": "\"project-DOC32\"", "limit": 1000}]}'
Python
import meilisearch
client = meilisearch.Client('https://openapi.fwf.ac.at', '<FWF Open API Key>')
output, funding = client.multi_search([{"indexUid": "output", "q": "\"project-DOC32\"", "limit": 1000}, {"indexUid": "further-funding", "q": "\"project-DOC32\"", "limit": 1000}])['results']
JavaScript
const { Meilisearch } = require("meilisearch");
const client = new Meilisearch({host: "https://openapi.fwf.ac.at", apiKey: "<FWF Open API Key>",});
const results = await client.multiSearch({queries: [{indexUid: "output", q: "\"project-DOC32\"", limit: 1000}, {indexUid: "further-funding", q: "\"project-DOC32\"", limit: 1000}]})
const [output, funding] = results.results;
PHP
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Meilisearch\Client;
use Meilisearch\Contracts\SearchQuery;
$client = new Client('https://openapi.fwf.ac.at', '<FWF Open API Key>');
[$out, $fun] = $client->multiSearch([
(new SearchQuery())->setIndexUid('output')->setQuery('\”project-DOC32\”')->setLimit(1000),
(new SearchQuery())->setIndexUid('output')->setQuery('\”project-DOC32\”')->setLimit(1000),
])['results'];
$output = $out['hits'];
$funding = $fun['hits'];
Support
Bei Fragen zur FWF Open API wenden Sie sich bitte an: openapi(at)fwf.ac.at