REW Beta Release REW API tips & tricks

serko70

Member
Thread Starter
Joined
Oct 13, 2017
Posts
332
Location
Germany
Let's explore the new REW Beta API in this thread.

Please feel free to brainstorm more methods and discuss tips & tricks for unlocking the API's full potential!

Here are two very simple HTML scripts (runs in any web browser hence platform free - also happens to be my current capability).

Retrieve REW Beta version information and display on browser window:

<<!DOCTYPE html>
<html>
<body>
<p>REW Version: <span id="version"></span></p>
<script>
fetch('http://localhost:4735/version')
.then(response => response.json())
.then(data => document.getElementById("version").innerText = data.message);
</script>
</body>
</html>


Generate a standard minimum phase version of a REW measurement (first one in this example) which will include mic calibration file effects:

<!DOCTYPE html>
<html>
<body>
<script>
const apiUrl = 'http://localhost:4735/measurements/1/command'; //first measurement
const defaultParameters = {
command: 'Minimum phase version',
parameters: {
"include cal": "true",
"append lf tail": "false",
"append hf tail": "false",
"frequency warping": "false",
"replicate data": "false"
}
};
const response = fetch(apiUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(defaultParameters)
});
</script>
</body>
</html>



Copy paste the above to any text editor, save as "filename.html" and it will run in your default browser. REW API server should have been started (preferences/API) and running on port 4735.
 
Back
Top